Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save stevengonsalvez/5724a0a008e5282a49469a13525de109 to your computer and use it in GitHub Desktop.
Save stevengonsalvez/5724a0a008e5282a49469a13525de109 to your computer and use it in GitHub Desktop.
default-server-platform-response-api.js
const express = require('express')
const os = require('os')
const app = express()
const port = process.env.APP_PORT || 80
var response = '<html><body> <h1>'
response += 'Hello from' + os.hostname() + '</h1>'
response += 'Type:' + os.type() + '<br/>'
response += 'Platform: ' + os.platform() + '<br/>'
response += 'Arch: ' + os.arch() + '<br/>'
response += 'Release: ' + os.release() + '<br/>'
response += '</body></html>'
app.get('/', (req, res) => res.send(response))
app.listen(port, () => console.log('Example app listening on port!' + port))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment