spaz-server
v1.0.0-rc1
Published
Spaz Microframework server component for Express API backend
Downloads
1
Readme
spaz
Spaz Microframework server component for Express API backend.
Architecture
- Express Web Framework
- Curated Express Middlewares
- Body Parser
- Connect Request Id
- Bunyan logger with auto-attached middleware
- Auto-attached error handler middleware
Installation
Requires Node.js v6 or later
Use the spaz-cli
tool to generate a full Spaz project:
npm install -g spaz-cli
spaz new <project>
Or install the spaz-server
separately through npm
:
npm install --save spaz-server
Example
import SpazServer from 'spaz-server'
let spaz = new SpazServer({
name: 'Spaz Test',
port: process.env.PORT,
staticDir: process.env.NODE_ENV !== 'production' ? 'assets' : null
})
/*
* Add routes to the SPAZ Router
*/
// let routes = spaz.newRouter()
// spaz.router.use(routes)
spaz
.start()
.then(() => {
spaz.logger.info('Spaz running!')
})
API Documentation
Coming ...