-
Notifications
You must be signed in to change notification settings - Fork 16
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
6 changed files
with
3,097 additions
and
59 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
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,8 +1,6 @@ | ||
const routes = { | ||
'GET /user:id': 'UserController.get', | ||
'POST /user': 'UserController.create', | ||
}; | ||
|
||
'GET /user': 'UserController.get', | ||
'POST /user': 'UserController.create' | ||
|
||
} | ||
|
||
export default routes; | ||
export default routes; |
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,30 +1,16 @@ | ||
export default class UserController { | ||
|
||
get (req,res) { | ||
|
||
res.send('get user') | ||
|
||
} | ||
|
||
|
||
create (req,res) { | ||
|
||
res.send('created user: ' + req.body.name); | ||
|
||
} | ||
|
||
|
||
destroy (req,res) { | ||
|
||
res.send('get user') | ||
|
||
} | ||
|
||
|
||
update (req,res) { | ||
|
||
res.send('created user: ' + req.body.name); | ||
|
||
} | ||
|
||
} | ||
const UserController = () => { | ||
const get = (req, res) => { | ||
res.send(`user with id: ${req.params.id}`); | ||
}; | ||
|
||
const create = (req, res) => { | ||
res.send('created user'); | ||
}; | ||
|
||
return { | ||
get, | ||
create, | ||
}; | ||
}; | ||
|
||
export default UserController; |
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 |
---|---|---|
|
@@ -9,11 +9,11 @@ | |
"author": "Lukas Aichbauer <[email protected]> (https://github.com/rudolfsonjunior/)", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"babel-polyfill": "^6.23.0", | ||
"babel-preset-env": "^1.1.11", | ||
"del": "^2.2.2", | ||
"gulp": "^3.9.1", | ||
"gulp-babel": "^6.1.2", | ||
"gulp-concat": "^2.6.1", | ||
"gulp-load-plugins": "^1.5.0", | ||
"gulp-newer": "^1.3.0", | ||
"gulp-nodemon": "^2.2.1", | ||
|
@@ -23,6 +23,6 @@ | |
"dependencies": { | ||
"body-parser": "^1.17.1", | ||
"express": "^4.15.2", | ||
"express-routes-mapper": "0.0.x" | ||
"express-routes-mapper": "^0.1.1" | ||
} | ||
} |
Oops, something went wrong.