generated from GenerateNU/GenerateHWBase
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor routes and remove commented code
- Loading branch information
Showing
2 changed files
with
18 additions
and
17 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,18 +1,18 @@ | ||
import express from "express"; | ||
// // import adminRoutes from "./routes/routers.mjs"; | ||
// // import oceanDataRoutes from "./routes/routers.mjs"; | ||
// import test from "./routes/routers.mjs"; | ||
import test from "./routes/routers.mjs"; | ||
import serverless from "serverless-http"; | ||
const app = express(); | ||
app.use(express.json()); | ||
|
||
// // app.use("/wavewise-backend", adminRoutes); | ||
// // app.use("/wavewise-backend", oceanDataRoutes); | ||
|
||
// app.use("/", test); | ||
app.use("/", test); | ||
|
||
app.get("/wavewise-backend", (req, res) => { | ||
res.json({ message: "Welcome to WaveWise Backend" }); | ||
}); | ||
// app.get("/wavewise-backend", (req, res) => { | ||
// res.json({ message: "Welcome to WaveWise Backend" }); | ||
// }); | ||
|
||
export const handler = serverless(app); |
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,18 +1,19 @@ | ||
// routes/adminRoutes.ts | ||
import express from "express"; | ||
import { authenticateAdmin } from "../controller/authController.mjs"; | ||
import { | ||
addOceanData, | ||
getOceanData, | ||
} from "../controller/oceanDataController.mjs"; | ||
const router = express(); | ||
|
||
// import express from "express"; | ||
// import { authenticateAdmin } from "../controller/authController.mjs"; | ||
// import { | ||
// addOceanData, | ||
// getOceanData, | ||
// } from "../controller/oceanDataController.mjs"; | ||
router.post("/admin/authenticate", authenticateAdmin); | ||
|
||
// const router = express.Router(); | ||
router.post("/ocean-data", addOceanData); | ||
|
||
// router.post("/admin/authenticate", authenticateAdmin); | ||
router.get("/ocean-data", getOceanData); | ||
|
||
// router.post("/ocean-data", addOceanData); | ||
|
||
// router.get("/ocean-data", getOceanData); | ||
router.get("/wavewise-backend", (req, res) => { | ||
res.json({ message: "Welcome to WaveWise Backend" }); | ||
}); | ||
|
||
export default router; |