- app.use(express.static(path.join(__dirname, '/dist/public'), { maxAge: maxAge }))
- app.use(express.static(path.join(__dirname, '/dist/views'), { maxAge: maxAge }))
- } else {
- // Livereload
- app.use(require('connect-livereload')({
- port: 35729
- }))
-
- require('segfault-handler').registerHandler()
-
- app.use(express.static(path.join(__dirname, '/public'), { maxAge: 0 }))
-
- // Jade template from ./views directory
- app.set('views', path.join(__dirname, '/views'))
- app.set('view engine', 'jade')
-
- // Views routes
- app.use('/', routes)
- }
+ // API routes
+ var api_route = '/api/' + global.API_VERSION
+ app.use(api_route, routes.api)