Framework for creating REST-based NodeJS applications with ease.
npm install restate
|36||downloads in the last month|
|Version||0.5.3 last updated 23 days ago|
|Keywords||connect, rest, restful, framework, project, app, application|
|Dependencies||async, underscore, underscore.string, wrench|
restate is a simple framework aiding the creation of REST-based nodejs applications.
Generates everything you need: build files, ready-to-serve server code, project folder structure, basic deployment stage-levels
The server-side code is already clustered using NodeJS's cluster. Main script is:
server / cluster.js
The generated project is ready to abstract layouts, styles, JS code and inherit/share it to multiple sites if needed. See for details below.
$ npm install -g restate
Step into a folder where you want to create your new project folder and execute the following from command line:
$ restate projectName [--preserveFiles] [--noAA] [--noREST] [--noMongo] [--noKO]
This will create the project structure and scripts for it allowing you to build into 2 different stages: development and production.
restate finishes in an instant and you are ready to go! (have a running local mongo!)
And open browser:
--noWeb Keeps the project server-side only without any less-css-js-jade components including build steps --preserveFiles Will try not to override any existing files. --noAA Removes the built-in A&A tempalte code from the server-side. --noREST Removes the built-in RESTful tempalte code from the server-side. --noMongo Removes the built-in MongoDB tempalte code from the services-side --noKO Removes the built-in Knockout.js tempalte code from the client-side --noWebsocket Removes the built-in Websocket tempalte code from the services-side
.gitignore --- usual buildDevelopment.sh --- shorthand for gruntRun.sh buildProduction.sh --- shorthand for gruntRun.sh config/ --- json config files configuring server and db connectivity Gruntfile.js --- grunt file and plugins gruntRun.sh --- runs grunt with a parameter specifying the stage level package.json --- usual server/ --- js files of the server. RESTful services, connect server, A&A services, Mongo connectivity web/ --- dynamic web files abstract less/ --- folder for less files js/ --- folder for the js files lib/ --- folder for the external js files views/ --- folder for the jade files site less/ --- folder for less files js/ --- folder for the js files lib/ --- folder for the external js files views/ --- folder for the jade files www/ --- static files' folder
Every build will be put into the created 'dist' folder.
If your project is created without the argument
then you will have a web folder possessing 2 subfolders by default:
abstract and site
The concept is simple. There is an abstract folder for generic definitions inherited by all sites, and as many specific folder as you want to build up.
The abstract folder contains all less, js or jade files which should be inherited across the concrete sites you want to build up.
While the concrete pages' folders (site folder by default) are dedicated to defines the specific and unique part of a given site.
As you can see in the site folder example, you can inherit anything you need from the abstract folder keeping project maintainability at high level when multiple sites need to be built up and managed.
Contribute or Request
Feel free to add requests to extend the capabilities of this utility!