correzioni a Dockerfile, a tsconfig.json e creazione src/index.ts
This commit is contained in:
parent
c11f1eef15
commit
b897e6bb41
3 changed files with 21 additions and 2 deletions
|
|
@ -7,7 +7,7 @@ WORKDIR /app
|
|||
COPY package*.json ./
|
||||
RUN npm ci
|
||||
|
||||
COPY tsconfig.json tsconfig.build.json ./
|
||||
COPY tsconfig.json ./
|
||||
COPY src ./src
|
||||
RUN npm run build
|
||||
|
||||
|
|
|
|||
19
src/index.ts
Normal file
19
src/index.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import cors from "cors";
|
||||
import dotenv from "dotenv";
|
||||
import express from "express";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
const app = express();
|
||||
const port = Number(process.env.PORT) || 3005;
|
||||
|
||||
app.use(cors({ origin: process.env.FRONTEND_URL }));
|
||||
app.use(express.json());
|
||||
|
||||
app.get("/health", (_req, res) => {
|
||||
res.json({ status: "ok" });
|
||||
});
|
||||
|
||||
app.listen(port, () => {
|
||||
console.log(`Server listening on port ${port}`);
|
||||
});
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCaslignInFileNames": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"resolveJsonModule": true
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue