-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added helloWorldRouter in mongoose template #347
added helloWorldRouter in mongoose template
- Loading branch information
Showing
6 changed files
with
22 additions
and
13 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
7 changes: 0 additions & 7 deletions
7
packages/yonode-templates/JS-MongoDB-Mongoose-NoAuth-Template/src/controllers/controller.js
This file was deleted.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
...ode-templates/JS-MongoDB-Mongoose-NoAuth-Template/src/controllers/helloWorldController.js
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export const helloWorld = async (req, res) => { | ||
try { | ||
res.send("Hello World!"); | ||
} catch (error) { | ||
res.status(500).json({ | ||
message: "Internal Server Error", | ||
}); | ||
} | ||
}; |
8 changes: 8 additions & 0 deletions
8
packages/yonode-templates/JS-MongoDB-Mongoose-NoAuth-Template/src/routes/helloWorldRoutes.js
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import express from "express"; | ||
import { helloWorld } from "../controllers/helloWorldController.js"; | ||
|
||
const helloWorldRouter = express.Router(); | ||
|
||
helloWorldRouter.get("/", helloWorld); | ||
|
||
export default helloWorldRouter; |
5 changes: 0 additions & 5 deletions
5
packages/yonode-templates/JS-MongoDB-Mongoose-NoAuth-Template/src/routes/router.js
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.