module.exports = { main: (req, res) => { console.log("request /") res.render('index', { title: 'Hey', message: 'Hello there!' }) res.end('wut') // // res.type('html') // res.send(` // // //Welcome to Alex's express.js example // // //

Hi, thanks for using my Express.js lab 👏

// //

If you found it useful, view my other GitHub projects today 👑

// //

Results from GET /links:

// // // //

Copyright Alex Ellis 2020 ®

// // // //`); }, links: (req, res) => { res.type("json") res.send( [ { "name": "github", "url": "https://github.com/alexellis" }, { "name": "twitter", "url": "https://twitter.com/alexellisuk" }, { "name": "blog", "url": "https://blog.alexellis.io" }, { "name": "sponsors", "url": "https://github.com/users/alexellis/sponsorship" }, ]) }, health: (req, res) => { // Do an ES request client.ping({ // ping usually has a 3000ms timeout requestTimeout: 1000 }, function (error) { if (error) { console.trace('elasticsearch cluster is down!'); } else { console.log('All is well'); } }); res.send("OK"); } }