Skip to content

Instantly share code, notes, and snippets.

@chiehwen
Created July 16, 2014 07:39
Show Gist options
  • Select an option

  • Save chiehwen/c8587728823c276ae549 to your computer and use it in GitHub Desktop.

Select an option

Save chiehwen/c8587728823c276ae549 to your computer and use it in GitHub Desktop.
var userMgrAPI = express.Router();
// A set of API to manage users (/apis/admin/user/:username)
userMgrAPI.route('user/:username')
.get(function(req, res) {
// Getting user information
})
.post(function(req, res) {
// Create a new user
})
.delete(function(req, res) {
// Delete specific user
})
.put(function(req, res) {
// Update
});
app.use('/apis/admin', userMgrAPI);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment