Chapter 4,6: prettier updates and web framework samples

This commit is contained in:
Beth Griggs
2020-05-31 19:31:42 +01:00
parent b43bf2c378
commit 0d8170c265
43 changed files with 4820 additions and 242 deletions
+20
View File
@@ -0,0 +1,20 @@
const express = require("express");
const path = require("path");
const index = require("./routes/index");
const bodyParser = require("body-parser");
const PORT = process.env.PORT || 3000;
const app = express();
app.use(
bodyParser.urlencoded({
extended: false,
})
);
app.use(express.static(path.join(__dirname, "public")));
app.use("/", index);
app.listen(PORT, () => {
console.log(`Server listening on port ${PORT}`);
});