Skip to content

Instantly share code, notes, and snippets.

@a7ul
Last active July 15, 2018 07:07
Show Gist options
  • Save a7ul/84cab6e6a44ab2fcc5ff2b4042c01f7f to your computer and use it in GitHub Desktop.
Save a7ul/84cab6e6a44ab2fcc5ff2b4042c01f7f to your computer and use it in GitHub Desktop.
blog-console-web-ui-color-output
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