-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.ts
More file actions
28 lines (22 loc) · 748 Bytes
/
Copy pathapp.ts
File metadata and controls
28 lines (22 loc) · 748 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
import cookieParser from "cookie-parser";
import express from "express";
import logger from "morgan";
import * as path from "path";
import bookEntry from "./routes/book-entries";
import bookPage from "./routes/book-page";
const app = express();
const port = 3000;
app.use(logger(process.env.NODE_ENV || "dev"));
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, "public")));
app.get("/", (_, res) => {
res.redirect("https://cartersnich.github.io/unofficial-goalkicker-api/");
});
app.use("/book-entries", bookEntry);
app.use("/book-page", bookPage);
app.listen(port, () => {
console.log(`Server ready on port ${port}`);
});
export default app;