-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ts
36 lines (32 loc) · 1.34 KB
/
index.ts
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
30
31
32
33
34
35
36
import cors from "cors"
import express from "express"
import "./config/db"
import verifyToken from "./middlewares/verifyToken"
import { AdminRouter } from "./routers/AdminRouter"
import { AnggotaRouter } from "./routers/AnggotaRouter"
import { DivisiRouter } from "./routers/DivisiRouter"
import { JabatanRouter } from "./routers/JabatanRouter"
import { KategoriKegiatanRouter } from "./routers/KategoriKegiatanRouter"
import { KegiatanRouter } from "./routers/KegiatanRouter"
import { LevelRouter } from "./routers/LevelRouter"
import { LoginRouter } from "./routers/LoginRouter"
import { MiniclassRouter } from "./routers/MiniclassRouter"
import { NomorSuratRouter } from "./routers/NomorSuratRouter"
import { PresensiRouter } from "./routers/PresensiRouter"
const app = express()
app.use(cors())
app.use(express.json())
app.use("/uploads", express.static("uploads"))
app.use("/login", LoginRouter)
app.use(verifyToken)
app.use("/anggota", AnggotaRouter)
app.use("/divisi", DivisiRouter)
app.use("/jabatan", JabatanRouter)
app.use("/miniclass", MiniclassRouter)
app.use("/presensi", PresensiRouter)
app.use("/kegiatan", KegiatanRouter)
app.use("/kategoriKegiatan", KategoriKegiatanRouter)
app.use("/nomorSurat", NomorSuratRouter)
app.use("/admin", AdminRouter)
app.use("/level", LevelRouter)
app.listen(process.env.PORT || 3000, () => console.log("server started"))