Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Karan Santra KaranSantra

🎯
Focusing
View GitHub Profile
@KaranSantra
KaranSantra / Router.js
Last active Jul 8, 2021
Features of clean code architecture-node app
View Router.js
const express = require('express');
const router = express.Router();
const propertyController = require('../../controller/admin/property');
const adaptRequest = require('../../helpers/adaptRequest');
const sendResponse = require('../../helpers/sendResponse');
const auth = require('../../middleware/auth');
router.post('/admin/property/create', auth(['createByAdminInAdminPlatform']), (req, res, next) => {
req = adaptRequest(req);
propertyController.addProperty({
data: req.body,