-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.ts
More file actions
29 lines (22 loc) · 780 Bytes
/
Copy pathindex.ts
File metadata and controls
29 lines (22 loc) · 780 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
29
import express, { Express, Request, Response } from "express";
import bodyParser from "body-parser";
import cors from "cors"
import { redisInstance } from "./data/redis";
import LoopedSession from "../Types/sessionTypes";
import UserService from "./data/users";
// include .env
require('dotenv').config();
const app: Express = express();
const jsonParser = bodyParser.json();
const urlencodedParser = bodyParser.urlencoded({ extended: false });
app.use(bodyParser.json());
app.use(cors());
app.get("/", (req: Request, res: Response) => {
res.send("Hello, World!");
});
app.use("/api", require("./routers/API"));
app.use("/auth", require("./routers/Auth"));
// port should change later, from env file
app.listen(80, () => {
console.log(`[$api] API Server Started.`);
});