-
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.
Huge fucking refactor in two entities almost done
- Loading branch information
1 parent
f62a96c
commit bc4de38
Showing
27 changed files
with
96 additions
and
3,649 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 |
---|---|---|
|
@@ -3,3 +3,4 @@ node_modules/ | |
*.env | ||
.vscode/ | ||
doc/ | ||
package-lock.json |
File renamed without changes.
File renamed without changes.
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,27 @@ | ||
{ | ||
"name": "festiv.al-client", | ||
"version": "1.0.0", | ||
"description": "An app to search music concerts and festivals around you", | ||
"main": "start.js", | ||
"scripts": { | ||
"start": "nodemon start.js", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/maximelovino/festiv.al.git" | ||
}, | ||
"author": "Maxime Lovino and Thomas Ibanez", | ||
"license": "ISC", | ||
"bugs": { | ||
"url": "https://github.com/maximelovino/festiv.al/issues" | ||
}, | ||
"homepage": "https://github.com/maximelovino/festiv.al#readme", | ||
"dependencies": { | ||
"express": "^4.16.2", | ||
"material-components-web": "^0.24.0", | ||
"nodemon": "^1.12.1", | ||
"pug": "^2.0.0-rc.4", | ||
"request": "^2.83.0" | ||
} | ||
} |
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,32 @@ | ||
const express = require('express'); | ||
const router = express.Router(); | ||
const request = require('request'); | ||
const endpointBaseURL = "http:https://localhost:3000"; | ||
|
||
/** | ||
* Client routes | ||
*/ | ||
|
||
//Route to get the homepage of the site | ||
router.get('/', (req, res) => { | ||
res.render('home'); | ||
}); | ||
|
||
//Route to get the details page of a specific event | ||
router.get('/events/:id/detail', (req, res) => { | ||
const options = { | ||
method: 'GET', | ||
url: `${endpointBaseURL}/events/${req.params.id}/details`, | ||
} | ||
|
||
request(options, (error, response, body) => { | ||
if (!error && response.statusCode == 200) { | ||
const event = JSON.parse(body); | ||
res.render('eventDetail', { event }); | ||
} else { | ||
res.sendStatus(404); | ||
} | ||
}); | ||
}); | ||
|
||
module.exports = router; |
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
File renamed without changes.
File renamed without changes.
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,5 @@ | ||
const app = require('./app'); | ||
app.set('port', 80); | ||
const server = app.listen(app.get('port'), () => { | ||
console.log(`Express client running → ADDRESS http:https://localhost:${server.address().port}`); | ||
}); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.