This is a Slush generator that produces a skeleton application with the following components:
- AngularJS
- Gulp
- node.js: very thin layer, hosting the Angular code and proxying MarkLogic REST API requests
- Roxy Deployer: bootstrap MarkLogic databases, application servers, etc; scaffolding for MarkLogic REST API service extensions
-
node
-
npm
-
gulp
-
slush
$ npm install -g slush
$ npm install -g slush-marklogic-node
Go to the directory where your new project will be created (the parent). Then:
$ slush marklogic-node <app-name>
When the generator is finished, start up your application by:
- $ cd {app-name}
- edit deploy/build.properties; set the -port properties to available ports (defaults: 8040, 8041)
- $ ./ml local bootstrap
- $ ./ml local deploy modules
- edit gulpfile.js. In the options section near the top, set your desired ports
- $ gulp # this will watch the .less file for changes and compile them to .css
- $ gulp server
The application comes with 25 JSON documents generated by json-generator.com. You can load them with MLCP like this:
$ /path/to/mlcp.sh import -username admin -password admin -host localhost -port 8041 -input_file_path sample-data -document_type text -transform_module /transform/from-json.xqy -transform_namespace "http://marklogic.com/transform/from-json" -transform_function transform
Replace the username and password if needed. The from-json.xqy module is provided in the sample application under the src/transform directory.
The application assumes that you're storing JSON data. This shows up in the default format request for the MLRest service's searchContext, the detailController's (detail-ctrl.js) request to get a document, and in the out-of-the-box detail view.