Basic Typescript configuration.
This commit is contained in:
20
server.ts
Normal file
20
server.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import express, { Express, Request, Response } from "express";
|
||||
import dotenv from "dotenv";
|
||||
import { resolve } from "path";
|
||||
import InitServer from "./util/serverInit";
|
||||
import { JobsListMedia } from "./jobs/jobs.get";
|
||||
|
||||
dotenv.config({
|
||||
path: resolve(process.cwd(), `.env.${process.env.NODE_ENV || "development"}`),
|
||||
});
|
||||
|
||||
const app: Express = express();
|
||||
const port = process.env.PORT;
|
||||
|
||||
app.get("/", JobsListMedia);
|
||||
|
||||
InitServer();
|
||||
|
||||
app.listen(port, () => {
|
||||
console.log(`⚡️[server]: Server is running at https://localhost:${port}`);
|
||||
});
|
||||
Reference in New Issue
Block a user