🦠 Added ignored folder back to git tracking

Signed-off-by: Rishi Ghan <rishi.ghan@gmail.com>
This commit is contained in:
2021-04-15 15:15:23 -07:00
parent 2ccebf13b8
commit 22a5cba98d
11 changed files with 200 additions and 0 deletions

29
src/server/index.ts Normal file
View File

@@ -0,0 +1,29 @@
import express, { Request, Response, Router, Express } from "express";
import bodyParser from "body-parser";
import router from "./route";
// call express
const app: Express = express(); // define our app using express
// configure app to use bodyParser for
// Getting data from body of requests
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
const port: number = Number(process.env.PORT) || 8050; // set our port
// Send index.html on root request
app.use(express.static("dist"));
app.get("/", (req: Request, res: Response) => {
console.log("sending index.html");
res.sendFile("/dist/index.html");
});
// REGISTER ROUTES
// all of the routes will be prefixed with /api
const routes: Router[] = Object.values(router);
app.use("/api", routes);
app.listen(port);
console.log(`App listening on ${port}`);