I have this block of code:
// GET - Default (root) app.get('/', (req, res) => { console.log('GET request to "/"..'); res.header('content-type', 'text/html'); return res.end('' + '<h1>Welcome to the <a href="http://throneofli.es/game">Throne of Lies</a> API</h1>' + '<h2>Check back later for public routes.</h2>'); }); I tried running this in with Postman:
The results are an average of 21k to 22k ms:
Now, sometimes it's speedy, <150ms. However, most of the time, it's not. This is running off an ubuntu16LTS droplet from digitalocean. Is there something weird I'm doing? I'm still new to Node so surely it's in the code. My full code (not that much code) can be found here:
https://github.com/dylanh724/tol-node-public/blob/master/tol/server.js
EDIT 1: I tried using res.send instead of end, but that didn't seem to resolve anything.