You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
469 B
JavaScript
28 lines
469 B
JavaScript
7 years ago
|
'use strict';
|
||
|
|
||
|
const Promise = require("bluebird");
|
||
|
|
||
|
module.exports = function({db}) {
|
||
|
let router = require("express-promise-router")();
|
||
|
|
||
|
router.get("/", (req, res) => {
|
||
|
return Promise.try(() => {
|
||
|
return db("instances");
|
||
|
}).then((instances) => {
|
||
|
res.render("instances/list", {
|
||
|
instances: instances
|
||
|
});
|
||
|
});
|
||
|
});
|
||
|
|
||
|
router.get("/add", (req, res) => {
|
||
|
res.render("instances/add");
|
||
|
});
|
||
|
|
||
|
router.post("/add", (req, res) => {
|
||
|
|
||
|
})
|
||
|
|
||
|
return router;
|
||
|
}
|