app.js
441 Bytes
const express = require("express");
var app = express();
http = require('http').createServer(app);
port = 23023;
app.use(express.static(__dirname + "/views"));
const routes = require("./routes/");
app.use(routes)
app.use((err,req,res,next) => {
const {status,message} = err
console.error(err)
res.status(status||500).json({message})
})
var server = http.listen(port, function(){
console.log(`http://localhost:${port}`);
})