Friday 9 June 2017

i feel like i'm super close...

So i have two files script.js and app.js I'd like to log some message using my custom express middleware... I've been trying to solve this for the past 6 hours...Any help would be greatly appreciated//script.js (containing the portion of code i'm triggering from the front end)const router = express.Router();router.post('/myroute',(req, res, next) => {//doing somethingres.json({success: true, content: someObject});});//app.js ( containing the middleware portion limited to '/myroute')const app = express();app.use('/myroute', function(req, res, next) {console.log ("inside middleware why you no show up?");next();});

Submitted June 09, 2017 at 03:28PM by DepressedHypeman

No comments:

Post a Comment