commit 96dd9dd208b6d62a442421e22c47441028620cba
parent 2a527f98562d1d82ba6a0e1fff8e3a17193d7398
Author: Demonstrandum <moi@knutsen.co>
Date: Sat, 16 May 2020 22:42:17 +0100
Move to web completely.
Diffstat:
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/Procfile b/Procfile
@@ -1,2 +1 @@
-web: echo "No web-service here, please and thank you."
-worker: yarn start
+web: yarn start
diff --git a/lib/web.ts b/lib/web.ts
@@ -1,6 +1,8 @@
import http from 'http';
import { readFileSync as read_file } from 'fs';
+import process from 'process';
+const PORT = Number(process.env.PORT) || 8080;
export default handle_post => {
const request_listener: http.RequestListener = (req, res) => {
@@ -39,7 +41,7 @@ export default handle_post => {
}
};
const server = http.createServer(request_listener);
- server.listen(8080, '0.0.0.0', () => {
+ server.listen(PORT, '0.0.0.0', () => {
console.log(`Web server started on http://0.0.0.0:8080/`)
});
};