-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
29 lines (24 loc) · 729 Bytes
/
index.js
File metadata and controls
29 lines (24 loc) · 729 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import express from "express";
import dotenv from "dotenv";
dotenv.config();
import { PrismaClient } from "@prisma/client";
import router from "./routes/api.routes.js";
import cors from "cors";
import helmet from "helmet";
import { limiter } from "./config/ratelimit.js";
import "./jobs/index.js"
const prisma = new PrismaClient();
const app = express();
const PORT = process.env.PORT || 3000;
app.use(helmet());
app.use(cors({
origin:"*"
}));
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(limiter);
// app.use("/", (req, res) => {
// res.send("hola this is working");
// });
app.use("/api", router);
app.listen(PORT, () => console.log(`we are here with prisma on port ${PORT}`));