################################################################################
# #
# db db .8888. dP 888888b 8888ba .8888. d8b db 888888b d8888P #
# 88 88 d8' `8b 88 88 88 `8b d8' `8b 88V8 88 88 88 #
# Y8 8P 88 88 88 a88aaa 88aa8P' 88 88 88 V8 88 88aaa 88 #
# `8b d8' 88 88 88 88 88 `8b 88 88 88 V888 88 88 #
# `8bd8' Y8. .8P 88 88 88 .88 Y8. .8P dP 88 V88 88 88 #
# YP `888P' 88888P 888888P 888888' `888P' 88 VP 8P 888888P dP #
# #
################################################################################
https://codeclimate.com/github/volebo/volebo-express
Express JS server for Volebo.Net
First, use this project as a dependency for your project.
Since the codebase isn't mature (at any level), it is better to use
npm link @volebo/express
than npm install
.
Then, just follow this sample:
'use strict'
// require the module:
const vbexpress = require('@volebo/express')
const configPath = 'server/config.yaml'
const overrideOpts = {
'debug': true
}
// create an instance with appropriate options:
const app = vbexpress(configPath, overrideOpts)
// Add routes (no lang-handler):
const routes = require('./routes')
app.use('/', routes)
// Add routes with language-culture detection:
const routesL10N = require('./routes2')
app.lang.use('/', routesL10N)
// start handling
app.start()
Custom configuration of the server. It contains our own crutches and fixes.
Handlebars engine with registered HBS-helpers by Assemble-team
Express router, created by the express-mw-lang
module.
Bunyan logger.
This module extends standard req
and res
with additional fields. Also, this
module is sensitive to several fields of the req
and res
.
This object will be used as per-request HBS-helpers (see this documentation for additional details).
The main purpose: set locale for handling current request with client's locale settings.
The extensions for res.locals, generated by the express-mw-lang module.
Information about logged-in user. User is authenticated (by PassportJS) and partially filtered (a few fields are accessible).
See res.locals.lang
Describes, whether the front end server currently handles HTTPS query (after proxying it becomes HTTP).
All thanks and praises go to:
- ExpressJS and many contributors of the ExpressJS org
- Express Handlebars
- PassportJS and Jared Hanson
- Bunyan Logger
- MessageFormat for their implementation of ICU standard (I18N/L10N)
- Sentry - awesome error collector
Please, follow the link: LICENSE