Jobs Media List functional
This commit is contained in:
16
server.ts
16
server.ts
@@ -1,8 +1,10 @@
|
||||
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";
|
||||
import path, { resolve } from "path";
|
||||
import InitServer, { FolderPaths } from "./util/serverInit";
|
||||
import { JobsListMedia } from "./jobs/jobsListMedia";
|
||||
import bodyParser from "body-parser";
|
||||
import JobRequestValidator from "./jobs/jobRequestValidator";
|
||||
|
||||
dotenv.config({
|
||||
path: resolve(process.cwd(), `.env.${process.env.NODE_ENV || "development"}`),
|
||||
@@ -10,11 +12,15 @@ dotenv.config({
|
||||
|
||||
const app: Express = express();
|
||||
const port = process.env.PORT;
|
||||
app.use(bodyParser.json({ limit: "50mb" }));
|
||||
app.use(bodyParser.urlencoded({ limit: "50mb", extended: true }));
|
||||
app.use(FolderPaths.StaticPath, express.static(FolderPaths.Root));
|
||||
|
||||
app.get("/", JobsListMedia);
|
||||
app.get("/jobs/list", JobRequestValidator, JobsListMedia);
|
||||
app.post("/jobs/upload", JobRequestValidator, JobsListMedia);
|
||||
|
||||
InitServer();
|
||||
|
||||
app.listen(port, () => {
|
||||
console.log(`⚡️[server]: Server is running at https://localhost:${port}`);
|
||||
console.log(`ImEX Media Server is running at https://localhost:${port}`);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user