This commit is contained in:
parent
43e70e243c
commit
3e88dab7da
2
index.js
2
index.js
@ -52,6 +52,7 @@ app.use(express.static('public'));
|
|||||||
const homeRoutes = require('./src/routes/home');
|
const homeRoutes = require('./src/routes/home');
|
||||||
const itemRoutes = require('./src/routes/item');
|
const itemRoutes = require('./src/routes/item');
|
||||||
const licenseRoutes = require('./src/routes/license');
|
const licenseRoutes = require('./src/routes/license');
|
||||||
|
const searchRoutes = require('./src/routes/search');
|
||||||
|
|
||||||
// register route handlers
|
// register route handlers
|
||||||
app.get('/', homeRoutes.getIndex);
|
app.get('/', homeRoutes.getIndex);
|
||||||
@ -65,6 +66,7 @@ app.post('/license/add', licenseRoutes.postAdd);
|
|||||||
app.get('/license/:id', licenseRoutes.getLicense);
|
app.get('/license/:id', licenseRoutes.getLicense);
|
||||||
app.get('/license/:id/edit', licenseRoutes.getEdit);
|
app.get('/license/:id/edit', licenseRoutes.getEdit);
|
||||||
app.post('/license/:id/edit', licenseRoutes.postEdit);
|
app.post('/license/:id/edit', licenseRoutes.postEdit);
|
||||||
|
app.get('/search', searchRoutes.getSearch);
|
||||||
|
|
||||||
// start app
|
// start app
|
||||||
app.listen(config.get('server.port'), config.get('server.address'), () => {
|
app.listen(config.get('server.port'), config.get('server.address'), () => {
|
||||||
|
@ -3,7 +3,7 @@ const Item = db.items;
|
|||||||
const License = db.licenses;
|
const License = db.licenses;
|
||||||
|
|
||||||
// GET - /search
|
// GET - /search
|
||||||
exports.getIndex = async function(req, res) {
|
exports.getSearch = async function(req, res) {
|
||||||
// decode URL search query
|
// decode URL search query
|
||||||
let query = req.params.query;
|
let query = req.params.query;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user