Skip to content

Instantly share code, notes, and snippets.

@artemis15
Created September 16, 2019 18:27
Show Gist options
  • Save artemis15/e0f0ed4c0969c0fc3c5cca3bcb8ab9bf to your computer and use it in GitHub Desktop.
Save artemis15/e0f0ed4c0969c0fc3c5cca3bcb8ab9bf to your computer and use it in GitHub Desktop.
Controlling logic for api routing based on HTTP Methods
const express = require('express');
const userService = require('../../services/users/userService');
let userControllerRouter = express.Router();
userControllerRouter.get('/', userService.getUsers);
userControllerRouter.post('/', userService.createUser);
module.exports = userControllerRouter;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment