This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
2017-02-20 08:45:14 +00:00
|
|
|
#!/usr/bin/env node
|
2017-02-17 09:24:29 +00:00
|
|
|
import { docopt } from 'docopt';
|
|
|
|
import createServer from './server';
|
2017-02-17 21:16:07 +00:00
|
|
|
import getArgs from './cli';
|
2018-03-15 22:01:07 +00:00
|
|
|
import open from 'open';
|
2017-02-17 09:24:29 +00:00
|
|
|
|
2017-02-17 21:22:38 +00:00
|
|
|
const ARGS = getArgs();
|
2017-02-20 08:45:14 +00:00
|
|
|
|
|
|
|
console.log("Starting Server...");
|
2017-02-17 21:22:38 +00:00
|
|
|
const app = createServer(ARGS);
|
|
|
|
|
2017-02-17 21:39:44 +00:00
|
|
|
export const server = app.listen(ARGS.port, function () {
|
2017-02-17 21:33:32 +00:00
|
|
|
const port = server.address().port;
|
|
|
|
console.log("Server started on port " + port);
|
|
|
|
if (ARGS.open) {
|
|
|
|
open('http://0.0.0.0:' + port);
|
|
|
|
}
|
2017-02-17 09:24:29 +00:00
|
|
|
});
|