Created
December 4, 2016 23:54
-
-
Save TyrfingMjolnir/d3b48b5882b6a3a01d1a05bd0df4aa1d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
func setupItem( router: Router ) { | |
router.post( "/:id" ) { | |
let myJSON = JSON( ["HTTP _POST item id": id] ) | |
response.status( 200 ).send( json: myJSON ) | |
next() | |
} | |
router.get( "/:id" ) { | |
let myJSON = JSON( ["HTTP _GET item id ": id] ) | |
response.status( 200 ).send( json: myJSON ) } | |
next() | |
} | |
router.put( "/:id" ) { | |
let myJSON = JSON( ["HTTP _PUT item id ": id] ) | |
response.status( 200 ).send( json: myJSON ) } | |
next() | |
} | |
router.delete( "/:id" ) { | |
let myJSON = JSON( ["HTTP _DELETE item id ": id] ) | |
response.status( 200 ).send( json: myJSON ) } | |
next() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment