-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
58 changed files
with
710 additions
and
1,118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,28 @@ | ||
import cors from "cors"; | ||
import dotenv from "dotenv"; | ||
import express from "express"; | ||
import authRoutes from "./src/routes/auth-route.js"; | ||
import logRoutes from "./src/routes/logbooks-route.js"; | ||
import authRoutes from "./src/routes/authRoutes.js"; | ||
import logRoutes from "./src/routes/logRoutes.js"; | ||
import transcriptionRoutes from "./src/routes/transcriptionRoutes.js"; | ||
import fileUpload from "express-fileupload"; | ||
|
||
dotenv.config(); | ||
|
||
const corsOptions = { | ||
origin: ["http://localhost:5173"], | ||
origin: ["http://localhost:5173"], | ||
}; | ||
const app = express(); | ||
const PORT = process.env.PORT || 8080; | ||
|
||
app.use(cors(corsOptions)); | ||
app.use(express.json()); | ||
app.use(fileUpload()); | ||
|
||
app.use('/api/auth', authRoutes); | ||
app.use('/api/logbooks', logRoutes); | ||
//Routes | ||
app.use("/api/auth", authRoutes); | ||
app.use("/api/log", logRoutes); | ||
app.use("/api/transcriptions", transcriptionRoutes); | ||
|
||
app.listen(PORT, () => { | ||
console.log(`Server listening on ${PORT}`); | ||
console.log(`Server listening on ${PORT}`); | ||
}); | ||
|
Oops, something went wrong.