-
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.
- Loading branch information
Showing
8 changed files
with
44 additions
and
26 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const express = require('express'); | ||
const app = express(); | ||
const home = require('./src/routes/HomeRoute'); | ||
|
||
|
||
// routers | ||
app.use('/', home); | ||
|
||
module.exports = 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,16 +1,6 @@ | ||
const express = require('express'); | ||
const app = express() | ||
const port = 8000; | ||
const app = require('./app'); | ||
require('dotenv').config(); | ||
|
||
|
||
app.get('/', (req, res) =>{ | ||
res.send("hello world"); | ||
}) | ||
|
||
// Routes | ||
app.use('/events/upcomingEvents', require('./routes/Events/upcomingEvents')); | ||
|
||
|
||
app.listen(port, ()=>{ | ||
console.log(`App listening at http://localhost:${port}`); | ||
app.listen(process.env.PORT, ()=>{ | ||
console.log(`App listening at http://localhost:${process.env.PORT}`); | ||
}) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"dotenv": "^16.0.3", | ||
"express": "^4.18.2" | ||
} | ||
} |
Empty file.
This file was deleted.
Oops, something went wrong.
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,6 @@ | ||
exports.home = (req, res) => { | ||
res.status(200).json({ | ||
success: true, | ||
greeting: "Home controller working OK", | ||
}); | ||
}; |
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,10 @@ | ||
const express = require('express') | ||
|
||
//import homeController | ||
const { home } = require('../controller/HomeController') | ||
const router = express.Router(); // New router instance from express library | ||
|
||
//routes | ||
router.route("/").get(home) | ||
|
||
module.exports = router |