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.
24 lines
468 B
JavaScript
24 lines
468 B
JavaScript
5 years ago
|
"use strict";
|
||
|
|
||
|
const express = require("express");
|
||
|
const knex = require("knex");
|
||
|
const path = require("path");
|
||
|
|
||
|
const config = require("./config.json");
|
||
|
const indexRouters = require("./routers/index");
|
||
|
|
||
|
let db = knex({ /* ... config options go here ... */});
|
||
|
|
||
|
let dependencies = {
|
||
|
db: db,
|
||
|
config: config
|
||
|
};
|
||
|
|
||
|
let app = express();
|
||
|
|
||
|
app.set("view engine", "pug");
|
||
|
app.set("views", path.join(__dirname, "views"));
|
||
|
|
||
|
app.use(indexRouters(dependencies));
|
||
|
|
||
|
app.listen(3000);
|