Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Orion/Node/Getting started"

< Orion‎ | Node
(Making sure Orionode can launch npm)
(Feature comparison)
(45 intermediate revisions by 7 users not shown)
Line 1: Line 1:
Orionode is a minimal, single-user sever deployment of Orion used for Node development with Orion's editing environment.
+
Orion provides a minimal, single-user server deployment of Orion written in JavaScript that runs on [http://nodejs.org Node.js]. This implementation of Orion supports developing your own Node applications with Orion's editing environment.
  
 
==Features==
 
==Features==
 +
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:
 +
 
* Basic Navigator operations (Create file/folder, delete file/folder, copy/move/rename a file)
 
* Basic Navigator operations (Create file/folder, delete file/folder, copy/move/rename a file)
 
* Basic Editor operations (Edit file, save file, ETags)
 
* Basic Editor operations (Edit file, save file, ETags)
 
* Plugin operations (Install/uninstall plugins)
 
* Plugin operations (Install/uninstall plugins)
* Shell command for [[#Developing a node.js application|launching a node app]] (type <code>help node</code> in the Shell page to find out more)
 
* Shell command for supporting npm. (works the same as the usual <code>npm</code> console command).
 
 
* Gzip on server traffic to reduce download times
 
* Gzip on server traffic to reduce download times
* [[#Concatenation and Minification|Concatenation and Minification]] of pages (requires a manual step)
+
* Concatenation and minification of pages (requires a manual step)
* Client caching for static HTML+JS content (cache time: 2 hours)
+
 
 +
==== Feature comparison ====
 +
This table compares features between the Java and Node.js servers.
 +
 
 +
{| class="wikitable" style="text-align: center;"
 +
! || Java || Node
 +
|-
 +
| style="text-align:left;" | Users || multiple || single
 +
|-
 +
| style="text-align:left;" | Login API (<tt>/login</tt>) || ✔ ||
 +
|-
 +
| style="text-align:left;" | File operations (<tt>/file</tt>) || ✔ || ✔
 +
|-
 +
| style="text-align:left;" | Import zip/HTTP/SFTP (<tt>/import</tt>) || ✔ ||
 +
|-
 +
| style="text-align:left;" | Export zip/SFTP (<tt>/export</tt>) || ✔ ||
 +
|-
 +
| style="text-align:left;" | Persistent user preferences (<tt>/prefs</tt>) || ✔ ||
 +
|-
 +
| style="text-align:left;" | Git (<tt>/gitapi</tt>) || ✔ ||
 +
|-
 +
| style="text-align:left;" | Deploy to Cloud Foundry (<tt>/cfapi</tt>) || ✔ ||
 +
|-
 +
| style="text-align:left;" | Sites (<tt>/sites</tt>) || ✔ ||
 +
|-
 +
| style="text-align:left;" | User API (<tt>/users</tt>) || ✔ ||
 +
|-
 +
| style="text-align:left;" | Integrated system shell (pty) || || OS X and Linux only
 +
|-
 +
|}
  
 
== Requirements ==
 
== Requirements ==
* Node.js and npm.
+
* Node.js
* A modern web browser with Web Socket support (for example: Firefox 15, Chrome 22, Internet Explorer 10, Safari 6).
+
* A modern web browser.
  
 
== Getting Orionode and starting it ==
 
== Getting Orionode and starting it ==
You can obtain Orionode through npm (the easiest way) or by checking out its source repo and running it.
+
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 [[Orion/Getting_the_source#Node.js_on_local_computer| wiki page]].
  
 
=== Installing with npm ===
 
=== Installing with npm ===
# Run this command from a shell:<br><code> npm install orion</code><p>This should install Orionode into a node_modules subdirectory of your working directory.
+
To install Orion with the Node Package Manager (npm), simply run the following command from the shell:
#* If you're not interested in developing the Orionode server, add the <code>--production</code> flag for a slightly smaller download.
+
<code> npm install orion</code>
 +
This will install Orionode into a <code>node_modules</code> subdirectory of your working directory.
 +
* If you're not interested in developing the Orionode server, add the <code>--production</code> flag for a slightly smaller download.
 +
 
 +
=== Starting and stopping the server ===
 
# Launch Orion by running:<br><code>npm start orion</code>  
 
# Launch Orion by running:<br><code>npm start orion</code>  
 
#* If you need to pass [[#Server_command_line_arguments|command line arguments]] to the server, run the server.js file directly:<br><code>node node_modules/orion/server.js [arguments]</code>
 
#* If you need to pass [[#Server_command_line_arguments|command line arguments]] to the server, run the server.js file directly:<br><code>node node_modules/orion/server.js [arguments]</code>
# Go to http://localhost:8081 in your web browser to start using Orionode.  
+
# Go to http://localhost:8081 (or whatever port you provided in the server arguments) in your web browser to start using Orionode.  
 
+
# Stop the server by sending a kill signal from the console (typically Ctrl+C)
=== Installing from source ===
+
#[[Orion/Getting_the_source#Getting_the_source_onto_your_computer|Get the Orion source]]. You only need to get the [http://git.eclipse.org/c/orion/org.eclipse.orion.client.git client source].
+
#Open a command shell and change directory to '''org.eclipse.orion.client/modules/orionode'''.
+
#Run the <code>npm install</code> command to automatically download Orionode's dependencies.
+
#*If you're not interested in developing the server, you can instead run <code>npm install --production</code>, which omits the dev-time dependencies for a smaller download.
+
#* If you're not passing any command-line arguments to the server, you can just use <b>npm start</b>.
+
#Go to http://localhost:8081 (or whatever port you chose) in your web browser to start using Orionode.
+
  
=== Other recommended steps ===
+
=== The orion.conf file ===
These are not strictly necessary to run the server, but recommended anyway.
+
You can pass arguments to the server by editing the <code>orion.conf</code> file. It is found in the directory where you installed Orion (when installing from npm, this is typically <code>node_modules/orion/</code>). An alternate configuration file can be specified via [[#Server_command_line_arguments|command line arguments]].
  
 
===== Password =====
 
===== Password =====
#Create a one-line "password.txt" file containing a secret password. If you do not want a separate file for password, you can still define that in the <code>orion.conf</code> or just leave the pwd value as empty.
+
Add a line in your <code>orion.conf</code> file that looks like this:
#Launch the Orionode server with the <code>-password password.txt</code> argument.
+
  pwd=mysecretpassword
  
===== Making sure Orionode can launch npm =====
+
===== Node inspector web port =====
Orionode lets you use <code>npm</code> 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 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 <code>npm</code> separately, this guess may be wrong. If you see an error message on either server console or when you type npm in the shell page, you have to specify the path to <code>npm-cli.js</code> yourself:
+
Orion on Node runs a node inspector process with the "--web-port" arguments to avoid conflicting port number with others. The default port number is 8900 but you can change it in the conf file. The port number will be represented in the debug URL link like: yourOrionServer:node_inspector_port/debug?port=yourDebugPort
 +
  node_inspector_port=myPreferredPortNumber
  
#In the server directory, open the <code>orion.conf</code> file. Observe the <code>npm_path</code> setting. By default its value is empty.
+
===== Workspace =====
#*How to confirm: For instance, if you are using Bash just type <code>which npm</code> and see where the command is. The command should eventually use the npm-cli.js file. Make sure your npm-cli.js matches the npm_path value. If not, then change the npm-path value to match your environment. It can be either an absolute path or a path relative to your node executable.
+
Edit the <code>orion.conf</code> file and change the <code>workspace</code> option to point to a directory in your user space. If not specified, a default <code>.workspace</code> directory will be created in the Orion install directory. For example:
#Restart server. If you do not see any npm error from the server console, your npm path is set properly.
+
  workspace=/home/pi/Workspace/
 +
 
 +
===== Making sure Orion can launch npm =====
 +
Orion on Node lets you use <code>npm</code> 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, <code>npm-cli.js</code>) 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 <code>npm-cli.js</code> yourself:
 +
 
 +
#Find out where npm lives on your computer (npm must be in your PATH environment variable for this to work). From a command shell, run:
 +
#* On Windows: <code>where npm</code>
 +
#* On Mac OS/Linux: <code>which npm</code>
 +
#* The returned path will be a shell script (or a symbolic link to a script) that launches <code>npm-cli.js</code>. The path to <code>npm-cli.js</code> is what we need. Open up the script in a text editor, and copy the path of <code>npm-cli.js</code>.
 +
#In the server directory, open the <code>orion.conf</code> file. You'll find a <code>npm_path</code> option (by default its value is empty).
 +
#Set the value of <code>npm_path</code> option equal to the path to <code>npm-cli.js</code>.
 +
#* You can provide the path as an absolute path, or a path relative to your node executable.  
 +
#Start or restart the server. If you do not see any "npm" errors printed to the console, your npm path is set properly.
 +
 
 +
== Using a global installation of Orionode ==
 +
 
 +
=== Installing with npm ===
 +
To install Orion with the Node Package Manager (npm), simply run the following command from the shell:
 +
<code> npm install -g orion</code>
 +
This will install Orionode as a global package, enabling you to run from any directory.
 +
* If you're not interested in developing the Orionode server, add the <code>--production</code> flag for a slightly smaller download.
 +
* If you run into permissions problems, you may need to run with sudo, e.g. <code>sudo npm install -g orion</code>. (A global installation attempts to install in <code>bin</code> so that the command <code>orion</code> can be run in the shell.)
 +
 
 +
=== Starting and stopping the server ===
 +
# Launch Orion by running:<br><code>orion</code>
 +
#* There are a few different options for the global installation:
 +
#** <code>orion</code>: launches Orion on port 8081 using current working directory
 +
#** <code>orion <workspaceDir></code>: launches Orion on port 8081 using <workspaceDir>
 +
#** <code>orion -p <portno></code>: launches Orion on <portno> using current working directory
 +
#** <code>orion <workspaceDir> -p <portno></code>: launches Orion on <portno> using <workspaceDir>
 +
#** <code>orion -w <workspaceDir> -p <portno></code>: same as above, except order can be switched
 +
#* The global installation of Orion currently only supports the [[#Server_command_line_arguments|command line arguments]] -p and -w. It does not read from the orion.conf file.
 +
# Go to http://localhost:8081 (or whatever port you provided in the server arguments) in your web browser to start using Orionode.
 +
# Stop the server by sending a kill signal from the console (typically Ctrl+C)
  
 
== Server command line arguments ==
 
== Server command line arguments ==
All these arguments are optional.
+
When launching the server manually through node.js (<code>node [orion install dir]/server.js</code>), a number of optional arguments can be provided:
 +
; <code>-c</code> or <code>-config</code>
 +
: Path to an alternate orionode configuration file. Defaults to orion.conf. This is useful to run orionode from git sources without modifying the version controlled orion.conf file in the git working tree.
 
; <code>-p</code> or <code>-port</code>
 
; <code>-p</code> or <code>-port</code>
 
: The port that the Orion server will listen on. Defaults to 8081.
 
: The port that the Orion server will listen on. Defaults to 8081.
 
; <code>-pwd</code> or <code>-password</code>
 
; <code>-pwd</code> or <code>-password</code>
: Path to a file containing a password. If provided, Orionode will enforce HTTP Basic Authentication with the password (the auth 'User' field is ignored -- Orionode only verifies the password). Use caution: if you don't provide a password file, '''no authentication''' is used (so anyone request can read and write your files!).
+
: Path to a file containing a password. If provided, Orionode will enforce HTTP Basic Authentication with the password (the auth 'User' field is ignored -- Orionode only verifies the password). Use caution: if you don't provide a password file, '''no authentication''' is used (so anyone can access your Orionode server and read and write your files!).  
 
; <code>-w</code> or <code>-workspace</code>
 
; <code>-w</code> or <code>-workspace</code>
: The target directory for reading and writing files. Will be created if it doesn't exist. Defaults to a subdirectory named .workspace in the repository folder.
+
: The target directory for reading and writing files. Will be created if it doesn't exist. Defaults to a subdirectory named <code>.workspace</code> in the server directory. This option can also be set in your [[#The orion.conf file|orion.conf file]].
 
; <code>-dev</code>
 
; <code>-dev</code>
 
: Starts the server in development mode. In this mode, some client-side code is not cached by the browser, to ease development.
 
: Starts the server in development mode. In this mode, some client-side code is not cached by the browser, to ease development.
 
; <code>-log</code>
 
; <code>-log</code>
 
: Logs each request served to standard output.
 
: Logs each request served to standard output.
 +
Arguments passed on the command line override arguments set in the orion.conf file, when both are provided.
  
 
== Developing a node.js application ==
 
== Developing a node.js application ==
Line 67: Line 130:
 
#Use <code>npm install</code> to install your dependency packages if needed. You can use basically all the npm arguments here.
 
#Use <code>npm install</code> to install your dependency packages if needed. You can use basically all the npm arguments here.
 
#Use <code>node start yourApp.js</code> to start your application.
 
#Use <code>node start yourApp.js</code> to start your application.
#Use <code>node list</code> to monitor all the applications you've started and still running.
+
#Use <code>node list</code> to monitor any long-running applications you've started.
#Use <code>node stop PID</code> to stop an application if you want to force it to stop.
+
#Use <code>node stop [PID]</code> to stop an application if you want to force it to stop.
  
 
== Debugging a node.js application ==
 
== Debugging a node.js application ==
You can use Orionode to debug your node.js application. If you have exisiting node.js applications, make sure the code is under a subfolder in the -w option when you start Orionnode. This will give you easy access to your node.js apps from within Orionode.
+
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.
 
You can also create a new node.js application in your workspace.
 
#After Orionode starts, open the shell page and use help to see what commands are available.
 
#After Orionode starts, open the shell page and use help to see what commands are available.
 
#<code>cd</code> to the folder where your application lives.
 
#<code>cd</code> to the folder where your application lives.
 
#Use <code>node debug yourApp.js givenPort</code> to start your app in debug mode. You can start multiple apps in debug mode by repeating this step.
 
#Use <code>node debug yourApp.js givenPort</code> to start your app in debug mode. You can start multiple apps in debug mode by repeating this step.
#In the return value of the <code>node debug</code> command, you will see a "debugURL" string.
+
#In the return value of the <code>node debug</code> command, you will see a "Debug URL", which you can click to start debugging your app.
#Copy and paste the debug URL into a webkit browser (e.g., Chrome, Safari) and start debugging. The URL normally looks something like: <code>http://yourOrionNodeServer:8900/debug?port=theGivenPort</code>.
+
  
== Concatenation and Minification ==
+
The debug interface currently only works with Webkit browsers (Chrome, Safari).
By default the pages served up by Orionode are not concatenated or minified, so they will load rather slowly. You can mitigate this by running the client-side build. To do this, just run <code>build.js</code>, found in the <code>org.eclipse.orion.client/modules/orionode/build</code> directory:
+
  node ./build/build.js
+
{{warning| Running the script will overwrite files in your working directory! Make sure anything important is committed to a branch first.}}
+
 
+
Clear your browser cache. The next time you load Orionode, it should be much faster.
+
  
 
== Other ways of using Orionode ==
 
== Other ways of using Orionode ==
Line 95: Line 152:
 
#Select the '''Plugins''' category, click '''Install''', paste in the URL, click '''Submit'''.
 
#Select the '''Plugins''' category, click '''Install''', paste in the URL, click '''Submit'''.
 
#Return to the Navigator page. Your Orionode files should appear as a new filesystem in the left-hand sidebar.
 
#Return to the Navigator page. Your Orionode files should appear as a new filesystem in the left-hand sidebar.
 
== Unit tests ==
 
Our unit tests are written against the [http://visionmedia.github.com/mocha/ Mocha] test framework.
 
 
=== Running the tests ===
 
From the <code>org.eclipse.orion.client/modules/orionode</code> directory, just run the command:
 
  npm test
 
 
This will invoke Mocha and produce console output showing which tests passed and failed.
 
 
If you want to pass custom arguments to Mocha, you'll need to invoke it explicitly like this:
 
  ./node_modules/mocha/bin/mocha [debug] [options] [files]
 
 
To make this easier, you can install Mocha as a global npm package (<code>npm install mocha -g</code>), and then invoke it as simply <code>mocha</code> from a command shell.
 
 
=== Writing more tests ===
 
When you're prototyping a new feature, writing unit tests for it is always a good idea. Here's how to write a test:
 
# Create a new file <code>my_tests.js</code> in the <code>org.eclipse.orion.client/modules/orionode/test/</code> directory.
 
# Write your tests in the file. Here are two resources to help you get started:
 
#* [http://visionmedia.github.com/mocha/ Mocha reference]: the general structure of a test.
 
#* [http://visionmedia.github.com/superagent/ Superagent reference]: how to write concise assertions for testing HTTP.
 
# [[# Running the tests|Run the tests]].
 
#* You don't have to register your new tests with the framework; it will discover anything in the <code>test/</code> directory automatically.
 
 
Helper data or classes should go in <code>test/support/</code>.
 
  
 
== Security Concerns ==
 
== Security Concerns ==
Line 126: Line 158:
 
== Known Issues ==
 
== Known Issues ==
 
* See the [https://bugs.eclipse.org/bugs/buglist.cgi?list_id=4064489&classification=Eclipse&query_format=advanced&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&component=Node&product=Orion list of open bugs].
 
* See the [https://bugs.eclipse.org/bugs/buglist.cgi?list_id=4064489&classification=Eclipse&query_format=advanced&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&component=Node&product=Orion list of open bugs].
* There is no way to provide standard input to a running Node.js app.
 
* No source control integration yet. E.g.: Git support.
 
  
[[Category:Orion|Getting Started with Orion node]]
+
== See also ==
 +
* [[Orion/Node/Developing|Developing the Node server]]
 +
 
 +
[[Category:Orion|N]]
 +
[[Category:Orion/Node|G]]

Revision as of 17:47, 30 March 2015

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.

Features

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:

  • Basic Navigator operations (Create file/folder, delete file/folder, copy/move/rename a file)
  • Basic Editor operations (Edit file, save file, ETags)
  • Plugin operations (Install/uninstall plugins)
  • Gzip on server traffic to reduce download times
  • Concatenation and minification of pages (requires a manual step)

Feature comparison

This table compares features between the Java and Node.js servers.

Java Node
Users multiple single
Login API (/login)
File operations (/file)
Import zip/HTTP/SFTP (/import)
Export zip/SFTP (/export)
Persistent user preferences (/prefs)
Git (/gitapi)
Deploy to Cloud Foundry (/cfapi)
Sites (/sites)
User API (/users)
Integrated system shell (pty) OS X and Linux only

Requirements

  • Node.js
  • A modern web browser.

Getting Orionode and starting it

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.

Installing with npm

To install Orion with the Node Package Manager (npm), simply run the following command from the shell: npm install orion This will install Orionode into a node_modules subdirectory of your working directory.

  • If you're not interested in developing the Orionode server, add the --production flag for a slightly smaller download.

Starting and stopping the server

  1. Launch Orion by running:
    npm start orion
    • If you need to pass command line arguments to the server, run the server.js file directly:
      node node_modules/orion/server.js [arguments]
  2. Go to http://localhost:8081 (or whatever port you provided in the server arguments) in your web browser to start using Orionode.
  3. Stop the server by sending a kill signal from the console (typically Ctrl+C)

The orion.conf file

You can pass arguments to the server by editing the orion.conf file. It is found in the directory where you installed Orion (when installing from npm, this is typically node_modules/orion/). An alternate configuration file can be specified via command line arguments.

Password

Add a line in your orion.conf file that looks like this:

 pwd=mysecretpassword
Node inspector web port

Orion on Node runs a node inspector process with the "--web-port" arguments to avoid conflicting port number with others. The default port number is 8900 but you can change it in the conf file. The port number will be represented in the debug URL link like: yourOrionServer:node_inspector_port/debug?port=yourDebugPort

 node_inspector_port=myPreferredPortNumber
Workspace

Edit the orion.conf file and change the workspace option to point to a directory in your user space. If not specified, a default .workspace directory will be created in the Orion install directory. For example:

 workspace=/home/pi/Workspace/
Making sure Orion can launch npm

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:

  1. Find out where npm lives on your computer (npm must be in your PATH environment variable for this to work). From a command shell, run:
    • On Windows: where npm
    • On Mac OS/Linux: which npm
    • The returned path will be a shell script (or a symbolic link to a script) that launches npm-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.
  2. In the server directory, open the orion.conf file. You'll find a npm_path option (by default its value is empty).
  3. Set the value of npm_path option equal to the path to npm-cli.js.
    • You can provide the path as an absolute path, or a path relative to your node executable.
  4. Start or restart the server. If you do not see any "npm" errors printed to the console, your npm path is set properly.

Using a global installation of Orionode

Installing with npm

To install Orion with the Node Package Manager (npm), simply run the following command from the shell: npm install -g orion This will install Orionode as a global package, enabling you to run from any directory.

  • If you're not interested in developing the Orionode server, add the --production flag for a slightly smaller download.
  • If you run into permissions problems, you may need to run with sudo, e.g. sudo npm install -g orion. (A global installation attempts to install in bin so that the command orion can be run in the shell.)

Starting and stopping the server

  1. Launch Orion by running:
    orion
    • There are a few different options for the global installation:
      • orion: launches Orion on port 8081 using current working directory
      • orion <workspaceDir>: launches Orion on port 8081 using <workspaceDir>
      • orion -p <portno>: launches Orion on <portno> using current working directory
      • orion <workspaceDir> -p <portno>: launches Orion on <portno> using <workspaceDir>
      • orion -w <workspaceDir> -p <portno>: same as above, except order can be switched
    • The global installation of Orion currently only supports the command line arguments -p and -w. It does not read from the orion.conf file.
  2. Go to http://localhost:8081 (or whatever port you provided in the server arguments) in your web browser to start using Orionode.
  3. Stop the server by sending a kill signal from the console (typically Ctrl+C)

Server command line arguments

When launching the server manually through node.js (node [orion install dir]/server.js), a number of optional arguments can be provided:

-c or -config
Path to an alternate orionode configuration file. Defaults to orion.conf. This is useful to run orionode from git sources without modifying the version controlled orion.conf file in the git working tree.
-p or -port
The port that the Orion server will listen on. Defaults to 8081.
-pwd or -password
Path to a file containing a password. If provided, Orionode will enforce HTTP Basic Authentication with the password (the auth 'User' field is ignored -- Orionode only verifies the password). Use caution: if you don't provide a password file, no authentication is used (so anyone can access your Orionode server and read and write your files!).
-w or -workspace
The target directory for reading and writing files. Will be created if it doesn't exist. Defaults to a subdirectory named .workspace in the server directory. This option can also be set in your orion.conf file.
-dev
Starts the server in development mode. In this mode, some client-side code is not cached by the browser, to ease development.
-log
Logs each request served to standard output.

Arguments passed on the command line override arguments set in the orion.conf file, when both are provided.

Developing a node.js application

Now 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:

  1. Use the Navigator and Edit pages to create and edit your folders and node applications.
  2. Go to the Shell page.
  3. cd to the folder where your application lives.
  4. Use npm install to install your dependency packages if needed. You can use basically all the npm arguments here.
  5. Use node start yourApp.js to start your application.
  6. Use node list to monitor any long-running applications you've started.
  7. Use node stop [PID] to stop an application if you want to force it to stop.

Debugging a node.js application

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.

  1. After Orionode starts, open the shell page and use help to see what commands are available.
  2. cd to the folder where your application lives.
  3. Use node debug yourApp.js givenPort to start your app in debug mode. You can start multiple apps in debug mode by repeating this step.
  4. In the return value of the node debug command, you will see a "Debug URL", which you can click to start debugging your app.

The debug interface currently only works with Webkit browsers (Chrome, Safari).

Other ways of using Orionode

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.

  1. Visit this page on your Orionode server (the hostname will differ from this example) and copy its URL:http://yourOrionNodeServer:8081/plugins/fileClientPlugin.html
  2. Log in to Orionhub.
  3. Click the user menu in the top right-hand corner of the page, then click Settings.
  4. Select the Plugins category, click Install, paste in the URL, click Submit.
  5. Return to the Navigator page. Your Orionode files should appear as a new filesystem in the left-hand sidebar.

Security Concerns

No security is guaranteed or even implied at this moment. Always run Orionode with the -pwd flag to prevent unauthorized access to your files.

Known Issues

See also

Back to the top