Created the server.ts
This commit is contained in:
parent
246e9f51dd
commit
63fdd636c6
16
src/server.ts
Normal file
16
src/server.ts
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import express, { Application, Request, Response } from "express";
|
||||||
|
|
||||||
|
const app: Application = express();
|
||||||
|
const isDevelopment: boolean = process.env.NODE_ENV !== "production";
|
||||||
|
const port: number = parseInt(process.env.SERVER_PORT || "8076");
|
||||||
|
|
||||||
|
app.get("/", (req: Request, res: Response) => {
|
||||||
|
res.json({message: "The API is working!"});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
const run = () =>
|
||||||
|
app.listen(port, () => console.log(`QuickByte ${isDevelopment ? "development" : "production"} server started under port ${port}`));
|
||||||
|
|
||||||
|
|
||||||
|
run();
|
Loading…
x
Reference in New Issue
Block a user