* Middleware overhaul! - Remove unnecessary 'async' keywords from middleware functions - Ensure all middleware functions we create have names - Wrap the method contents of all async middleware functions in a try-catch+next(error) pattern * Use asyncMiddleware wrapper instead of try-catch+next(error) pattern * Remove unnecessary try-catch+next(error) pattern from context middleware
7 lines
290 B
JavaScript
7 lines
290 B
JavaScript
// prove to loader.io that we own this site
|
|
// by responding to requests like `/loaderio-12345/` with `loaderio-12345`
|
|
module.exports = function loaderIoVerification (req, res, next) {
|
|
if (!req.path.startsWith('/loaderio-')) return next()
|
|
return res.send(req.path.replace(/\//g, ''))
|
|
}
|