Skip to content

Instantly share code, notes, and snippets.

@enricopolanski
Created March 30, 2019 15:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enricopolanski/92e6fc28a66582ce5db0047ade6ff05a to your computer and use it in GitHub Desktop.
Save enricopolanski/92e6fc28a66582ce5db0047ade6ff05a to your computer and use it in GitHub Desktop.
const express = require('express')
const cool = require('cool-ascii-faces')
const app = express()
const port = 3000
const redditAnswerHTML =
`<div style="height:100%;width:100%;display:flex;justify-content:space-around;align-content:center">
<div style="height:100%;display:flex;justify-content:space-around;align-content:center;margin-top:32px;font-size:32px;font-weight:400;color:gray">${cool()}</div>
<div style="width:50%;margin-top:32px;font-size:32px;font-weight:400;font-family:Arial">
Because unless you're not hitting thousands+ of requests per second, but even then scaling is pretty trivial, writing backend in node is fast, easy cheap and accessible.
</div>
<div style="height:100%;display:flex;justify-content:space-around;align-content:centermargin-top:32px;font-size:32px;font-weight:400;color:gray">${cool()}</div>
</div>
`
app.get('/', (req, res) => res.send(redditAnswerHTML))
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