Chapter 6: code samples
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
const express = require("express");
|
||||
const path = require("path");
|
||||
const index = require("./routes/index");
|
||||
|
||||
const PORT = process.env.PORT || 3000;
|
||||
|
||||
const app = express();
|
||||
|
||||
app.use(express.static(path.join(__dirname, "public")));
|
||||
app.use("/", index);
|
||||
|
||||
app.listen(PORT, () => {
|
||||
console.log(`Server listening on port ${PORT}`);
|
||||
});
|
||||
Reference in New Issue
Block a user