Skip to content

Instantly share code, notes, and snippets.

@jurajpelikan
Created December 22, 2015 10:01
Show Gist options
  • Save jurajpelikan/cb65ebff15838d1de62c to your computer and use it in GitHub Desktop.
Save jurajpelikan/cb65ebff15838d1de62c to your computer and use it in GitHub Desktop.
import express from "express";
import yargs from "yargs";
const app = express();
const paths = {
root: "/"
};
const getUrl = (name) => {
if (paths[name]) {
return yargs.argv.ngrok + paths[name];
}
return yargs.argv.ngrok;
};
app.get(paths.root, (req, res) => {
res.send("<h1>Hey Ho Let's Go!</h1>");
});
app.listen(8000, () => {
console.log(`${getUrl("root")}`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment