Compare commits
2 Commits
bea5e1954f
...
cd1d482aa8
| Author | SHA1 | Date | |
|---|---|---|---|
| cd1d482aa8 | |||
| 0774014599 |
@@ -7,8 +7,8 @@ module.exports = async function () {
|
||||
// Start services that that the app needs to run (e.g. database, docker-compose, etc.).
|
||||
console.log('\nSetting up...\n');
|
||||
|
||||
const host = process.env.HOST ?? 'localhost';
|
||||
const port = process.env.PORT ? Number(process.env.PORT) : 3000;
|
||||
const host = process.env['HOST'] ?? 'localhost';
|
||||
const port = process.env['PORT'] ? Number(process.env['PORT']) : 3000;
|
||||
await waitForPortOpen(port, { host });
|
||||
|
||||
// Hint: Use `globalThis` to pass variables to global teardown.
|
||||
|
||||
@@ -4,7 +4,7 @@ import { killPort } from '@nx/node/utils';
|
||||
module.exports = async function () {
|
||||
// Put clean up logic here (e.g. stopping services, docker-compose, etc.).
|
||||
// Hint: `globalThis` is shared between setup and teardown.
|
||||
const port = process.env.PORT ? Number(process.env.PORT) : 3000;
|
||||
const port = process.env['PORT'] ? Number(process.env['PORT']) : 3000;
|
||||
await killPort(port);
|
||||
console.log(globalThis.__TEARDOWN_MESSAGE__);
|
||||
};
|
||||
|
||||
@@ -3,7 +3,7 @@ import axios from 'axios';
|
||||
|
||||
module.exports = async function () {
|
||||
// Configure axios for tests to use.
|
||||
const host = process.env.HOST ?? 'localhost';
|
||||
const port = process.env.PORT ?? '3000';
|
||||
const host = process.env['HOST'] ?? 'localhost';
|
||||
const port = process.env['PORT'] ?? '3000';
|
||||
axios.defaults.baseURL = `http://${host}:${port}`;
|
||||
};
|
||||
|
||||
@@ -18,7 +18,7 @@ async function bootstrap() {
|
||||
|
||||
const globalPrefix = 'api';
|
||||
app.setGlobalPrefix(globalPrefix);
|
||||
const port = process.env.PORT || 3000;
|
||||
const port = process.env['PORT'] || 3000;
|
||||
await app.listen(port);
|
||||
Logger.log(`Application is running on: http://localhost:${port}/${globalPrefix}`);
|
||||
}
|
||||
|
||||
@@ -64,7 +64,14 @@
|
||||
},
|
||||
"test": {
|
||||
"executor": "@angular/build:unit-test",
|
||||
"options": {}
|
||||
"options": {
|
||||
"watch": false
|
||||
},
|
||||
"configurations": {
|
||||
"watch": {
|
||||
"watch": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"serve-static": {
|
||||
"continuous": true,
|
||||
|
||||
Reference in New Issue
Block a user