/jsdo-node

Implementing the JSDO protocol in a Node.js server

Primary LanguageJavaScriptMIT LicenseMIT

Project Description

This project centers around a node server that takes data stored in a MongoDB and exposes it under the jsdo protocol. The serviceURI is http://nodejsdo-21944.onmodulus.net and the catalogURI is http://nodejsdo-21944.onmodulus.net/catalogURI. Each database requires a catalog that describes the properties of each data point and the functions available for manipulating the data. This project also contains a node file that tests the server to make sure it works properly. This can be viewed at http://angulardemo-21580.onmodulus.net/test. This data is also formatted using AngularJS at http://jsdo-node-angular-22603.onmodulus.net/.

Running the app

  1. (Optional) Make a MongoDB database on Modulus and fill in config.json. You can skip steps 1 & 2 if you already have your own database
  2. (Optional) Run fillDB.js to fill your MongoDB with test data
  3. Run npm install
  4. Run the application by invoking node app.js
    To test the app
  5. Fill in your service and catalog uri's in jsdoTester/app.js
  6. Run npm install in jsdoTester/
  7. Run jsdoTester/app.js using node
  8. Navigate to localhost:3000/test to see if your app is working.
    To view AngularJS use of app
  9. Navigate to localhost:3000. It should show a filled in table with the same data as in step 8.

Directory Descriptions

app.js                  --> main app for Service URI
config.json             --> configuration details for MongoDB server
data.json               --> test data used by the app
fillDB.js               --> code for filling in the database with the data in data.json
LICENSE.txt             --> MIT License
package.json            --> for npm
README.md               --> this file
Catalog/                --> contains the data catalog for the sample data used
  catalog.json          --> data catalog for the sample data used in the project
jsdoTester/             --> for testing the functionality of the jsdo server
  app.js                --> route for serving JSON. This is simulating Corticon.
  package.json          --> for npm
  progress.js           --> Progress code for working with JSDO
  progress.session.js   --> Progress code for working with JSDO
  XMLHttpRequest.js     --> Wrapper for js to emulate the browser XMLHttpRequest object
  public/               --> Displays test data in a prettier interface using AngularJS
    app.css             --> CSS file for making the HTML pretty
    main.jade           --> Jade that contains the rendered view of the app
    rest.js             --> Queries jsdoTester/app.js and sends data to main.jade

Relevant Blog Posts

Displaying OpenEdge Data in an AngularJS Web App
JSDO

License

MIT