express-roads

0.0.2 • Public • Published

nodejs-express-roads

NodeJS - Express Application and API Routes Management

Installation

npm install express-roads

Use

var http = require('http')
   ,express = require('express')
   ,ExpressRoads = require('express-roads')
   ,app = express();
 
ExpressRoads.initialize(app, {
   ,baseDir: __dirname
   ,routesDir: './src/routes' // Relative to baseDir

   ,useAPI: true
   ,apiBaseDir: './src/routes/api' // Relatives to baseDir
   ,debug: true
}, function() {

	//
	// Public directory to serve
	//
	app.use(express.static(path.join(__dirname, 'www')));


	//
	// Start listening...
	//
	http.createServer(app).listen(app.get('port'), function(){
	  console.log("\n[Started] Backend is listening on port: " + app.get('port'));
	});

});

See examples...

Readme

Keywords

none

Package Sidebar

Install

npm i express-roads

Weekly Downloads

1

Version

0.0.2

License

none

Last publish

Collaborators

  • fradinni