Skip to content

Instantly share code, notes, and snippets.

@JozefFlakus
Last active March 2, 2019 20:06
Show Gist options
  • Save JozefFlakus/dba51ef309ecdd3a5116beb0865d39ef to your computer and use it in GitHub Desktop.
Save JozefFlakus/dba51ef309ecdd3a5116beb0865d39ef to your computer and use it in GitHub Desktop.
const httpsOptions: https.ServerOptions = {
key: fs.readFileSync('key.pem'),
cert: fs.readFileSync('cert.pem'),
};
const listening$: HttpServerEffect = event$ =>
event$.pipe(
matchEvent(ServerEvent.listening),
map(event => event.payload),
tap(({ port, host }) => console.log(`Running @ http://${host}:${port}/`)),
);
const server = createServer({
port: 1337,
httpListener,
dependencies: [
bindTo(token_1)(dependency_1),
bindTo(token_2)(dependency_2),
bindTo(token_3)(dependency_3),
],
event$: (...args) => merge(
listening$(...args),
// ...
),
options: { httpsOptions },
});
server.run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment