Spaces:
Running
Running
Isitha Tennakoon commited on
Commit ·
ce3adc9
1
Parent(s): 0d65b6e
fixed port bindings for render
Browse files
keygenServer/server/server.ts
CHANGED
|
@@ -8,7 +8,7 @@ import crypto from 'crypto';
|
|
| 8 |
dotenv.config();
|
| 9 |
|
| 10 |
const app = express();
|
| 11 |
-
const port = process.env.PORT
|
| 12 |
|
| 13 |
// Whitelist of allowed client origins
|
| 14 |
const allowedOrigins = [
|
|
@@ -119,6 +119,6 @@ app.post('/api/addKey',
|
|
| 119 |
}
|
| 120 |
);
|
| 121 |
|
| 122 |
-
app.listen(port, () => {
|
| 123 |
console.log(`Server running on port ${port}`);
|
| 124 |
});
|
|
|
|
| 8 |
dotenv.config();
|
| 9 |
|
| 10 |
const app = express();
|
| 11 |
+
const port = process.env.PORT ? parseInt(process.env.PORT, 10) : 10000;
|
| 12 |
|
| 13 |
// Whitelist of allowed client origins
|
| 14 |
const allowedOrigins = [
|
|
|
|
| 119 |
}
|
| 120 |
);
|
| 121 |
|
| 122 |
+
app.listen(port, '0.0.0.0', () => {
|
| 123 |
console.log(`Server running on port ${port}`);
|
| 124 |
});
|