forked from denoland/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.ts
More file actions
20 lines (15 loc) · 757 Bytes
/
server.ts
File metadata and controls
20 lines (15 loc) · 757 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import "@std/dotenv/load";
import Server from "lume/core/server.ts";
import NotFoundMiddleware from "lume/middlewares/not_found.ts";
import apiDocumentContentTypeMiddleware from "./middleware/apiDocContentType.ts";
import createGAMiddleware from "./middleware/googleAnalytics.ts";
import redirectsMiddleware from "./middleware/redirects.ts";
import createRoutingMiddleware from "./middleware/functionRoutes.ts";
export const server = new Server({ root: "." });
server.use(redirectsMiddleware);
server.use(NotFoundMiddleware({ root: ".", page404: "./404/" }));
server.use(createRoutingMiddleware());
server.use(createGAMiddleware(server));
server.use(apiDocumentContentTypeMiddleware);
server.start();
console.log("Listening on http://localhost:8000");