Last active
July 15, 2018 07:07
-
-
Save a7ul/84cab6e6a44ab2fcc5ff2b4042c01f7f to your computer and use it in GitHub Desktop.
blog-console-web-ui-color-output
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const style = require('ansi-styles'); | |
const express = require('express'); | |
const hello = () =>` | |
${style.green.open}Hello Green!${style.green.close} | |
${style.red.open}Hello Red!${style.red.close} | |
`; | |
const app = express(); | |
app.get('/hello', (req, res) => { | |
res.send(hello()); | |
}); | |
const PORT = process.env.PORT || 3000; | |
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