17 lines
428 B
JavaScript
17 lines
428 B
JavaScript
let express = require("express");
|
|
let morgan = require("morgan");
|
|
|
|
let indexRoute = require("./routes/index");
|
|
let notFoundRoute = require("./routes/notFound");
|
|
let errorRoute = require("./routes/error");
|
|
|
|
let app = express();
|
|
|
|
|
|
app.use(morgan("dev"))
|
|
.use(express.static("public"))
|
|
.set("view engine", "pug")
|
|
.use("/", indexRoute)
|
|
.use(notFoundRoute)
|
|
.use(errorRoute)
|
|
.listen(process.env.PORT || 8080);
|