setup static serving and routing

This commit is contained in:
2017-01-21 15:20:21 -07:00
parent f448356454
commit 74453d75fc
9 changed files with 269 additions and 43 deletions

View File

@@ -2,5 +2,5 @@
module.exports = function enableAuthentication(server) {
// enable authentication
server.enableAuth();
// server.enableAuth();
};

View File

@@ -1,8 +1,13 @@
'use strict';
const pingRoute = require('./routes/ping');
module.exports = function(server) {
// Install a `/` route that returns server status
var router = server.loopback.Router();
router.get('/', server.loopback.status());
// Install a `/` route that returns server status
// router.get('/', server.loopback.status());
// Init other routes
pingRoute(router);
server.use(router);
};

View File

@@ -0,0 +1,3 @@
module.exports = router => {
router.get('/ping', (req, res) => res.send('pong'));
}