0.0.3 • Published 8 years ago
bluless v0.0.3
bluless
express-based application management
Usage
steps:
1: configure the initial file based on the example below (server.js)
2: create a folder named "app"
-> server.js
const express = require('express')
const bluless = require('bluless')
const app = express()
app.use(bluless('index'))
app.listen(3000, err => console.log(err || 'Running'))
-> index.js
module.exports = {
url: '/api',
middlewares: [ //can be array or string
'middlewares/admin' //You can return an object with methods and point them like this: @method
],
children: [ //can be array or string
'api/car/car.router'
]
}
-> car.js
module.exports = {
url: '/car',
controllers: [
{
url: '/',
method: 'get',
middlewares: 'api/car/car.middleware' ////can be array or string and you can return an object with methods and point them like this: @method
action: 'api/car/car.controller@store'
}
]
}
:) you can also get request and response from anywhere in the application.
const { Request, Response } = require('bluless')
const request = Request()
const response = Response()
License
MIT