Created
December 22, 2015 10:01
-
-
Save jurajpelikan/cb65ebff15838d1de62c to your computer and use it in GitHub Desktop.
This file contains 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
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