| Getting started with Orion on Node | ||
|---|---|---|
|
||
| Updating this document | ||
Orion provides a minimal, single-user server deployment of Orion written in JavaScript that runs on Node.js. This implementation of Orion supports developing your own Node applications with Orion's editing environment.
The JavaScript Orion server implementation is still very early access. There are many rough edges and missing features compared to the full Java-based Orion server. The JavaScript-based Orion server currently supports:
help node in the Shell page to find out more)
npm console command).You can obtain Orionode through npm (the easiest way) or by checking out its source repo and running it. Checking out the source is mainly of interest to developers wishing to work on or extend the Orion node server. For details on this approach see the Orion developer wiki page.
To install Orion with the Node Package Manager (npm), simply run the following command from the shell:
npm install orion
--production flag for a slightly smaller download.npm start orion
node node_modules/orion/server.js
arguments
These are not strictly necessary to run the server, but recommended anyway.
-password password.txt argument.You can also provide a password in an orion.conf file by including a line like:
pwd=mysecretpassword
Orion on Node lets you use npm commands in the Orion shell to manage the dependencies of a project you're writing. To do this, the server makes a guess about the path where the npm internals (specifically, npm-cli.js) are located on your computer. If you installed a recent version of Node.js, npm should be installed automatically and the guess should work. If you installed npm separately, this guess may be wrong. If you see an error message when launching the server or when you try to run npm commands in the Orion shell, it means the server failed to guess where npm lives, so you have to specify the path to npm-cli.js yourself:
where npmwhich npmnpm-cli.js. The path to npm-cli.js is what we need. Open up the script in a text editor, and copy the path of npm-cli.js.orion.conf file. You'll find a npm_path option (by default its value is empty).npm_path option equal to the path to npm-cli.js.
All these arguments are optional.
-p or -port-pwd or -password-w or -workspace.workspace in the server directory.-dev-logNow in the browser you can start to develop your node.js applications. Orionode uses largely the UI you're accustomed to from Orion. (Refer to Orion user guide for basic instructions). Please note that the Sites and Git pages are not available in Orionode. Here is a typical workflow:
cd to the folder where your application lives.npm install to install your dependency packages if needed. You can use basically all the npm arguments here.node start yourApp.js to start your application.node list to monitor any long-running applications you've started.node stop
PID to stop an application if you want to force it to stop.
You can use Orionode to debug your node.js application. If you have existing node.js applications, make sure the code is under a subfolder of the workspace (path provided by the -w option when you start Orionnode). This will give you easy access to your node.js apps from within Orionode. You can also create a new node.js application in your workspace.
cd to the folder where your application lives.node debug yourApp.js givenPort to start your app in debug mode. You can start multiple apps in debug mode by repeating this step.node debug command, you will see a "debugURL" string.
http://yourOrionNodeServer:8900/debug?port=theGivenPort.
You can use Orionode as a file server, to access your local files from http://www.orionhub.org/ (or any other Orion installation). All you need is Orionode and a publicly-accessible URL pointing to your local Orionode server.
No security is guaranteed or even implied at this moment. Always run Orionode with the -pwd flag to prevent unauthorized access to your files.
Getting Started with Orion node
|
||
| Updating this document |