-
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 index.js, add routes and update README
- Loading branch information
1 parent
dd96f2b
commit a3b6a1e
Showing
4 changed files
with
38 additions
and
18 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,2 +1,10 @@ | ||
# to-do-app | ||
To do app. | ||
|
||
|
||
ADD HANDLEBARS | ||
REDIRECT TO CORRECT PAGES | ||
ADD ERROR HANDLING | ||
ADD SOME USER SESSION | ||
ADD OWNERID FOR TASKS | ||
REFACTOR INDEX.JS [X] |
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
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,16 @@ | ||
const express = require('express'); | ||
const path = require('path'); | ||
const userController = require('../controllers/userController'); | ||
const router = express.Router(); | ||
|
||
router.get('/register', (req, res) => { | ||
res.sendFile(path.join(__dirname, '../register.html')); | ||
}); | ||
router.post('/register', userController.register); | ||
|
||
router.get('/login', (req, res) => { | ||
res.sendFile(path.join(__dirname, '../login.html')); | ||
}); | ||
router.post('/login', userController.login); | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const express = require('express'); | ||
const taskController = require('../controllers/taskController'); | ||
const router = express.Router(); | ||
|
||
router.get('/tasks', taskController.getTasks); | ||
router.post('/submit', taskController.createTask); | ||
router.put('/update/:id', taskController.updateTask); | ||
router.delete('/delete/:id', taskController.deleteTask); | ||
|
||
module.exports = router; |