-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
28 lines (22 loc) · 699 Bytes
/
server.js
File metadata and controls
28 lines (22 loc) · 699 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Dependencies
// =============================================================
var express = require("express");
var path = require("path");
const PORT = process.env.PORT || 3000;
const app = express();
app.use(express.urlencoded({ extended: true }));
app.use(express.json());
app.use(express.static("public"));
// require("./sketch.js");
// require("./markov.js");
// require("./fw.txt");
// require("./bonbon.txt");
app.get("/", function (req, res) {
res.sendFile(path.join(__dirname, "index.html"));
});
app.get("/haiku", function (req, res) {
res.sendFile(path.join(__dirname, "index2.html"));
});
app.listen(PORT, () => {
console.log(`App running on http://localhost:3000/`);
});