feat: add more configurable options
This commit is contained in:
parent
6e6dbb7959
commit
13edd682b8
@ -3,7 +3,9 @@
|
|||||||
## Environement Variables
|
## Environement Variables
|
||||||
|
|
||||||
| Name | Description | Default value |
|
| Name | Description | Default value |
|
||||||
| --- | --- | --- |
|
| --------------- | ------------------------------------------------------------ | ---------------- |
|
||||||
|
| `PORT` | Server listening port | 8080 |
|
||||||
|
| `GLOBAL_PREFIX` | API global prefix for every routes | `/api/v2` |
|
||||||
| `STORAGE_URI` | [keyv](https://github.com/lukechilds/keyv) connection string | `""` (in memory) |
|
| `STORAGE_URI` | [keyv](https://github.com/lukechilds/keyv) connection string | `""` (in memory) |
|
||||||
|
|
||||||
Availabe storage adapter: redis, mongo, postgres and mysql
|
Availabe storage adapter: redis, mongo, postgres and mysql
|
||||||
|
@ -5,8 +5,8 @@ async function bootstrap() {
|
|||||||
const app = await NestFactory.create(AppModule, {
|
const app = await NestFactory.create(AppModule, {
|
||||||
cors: true,
|
cors: true,
|
||||||
});
|
});
|
||||||
app.setGlobalPrefix('api/v2');
|
app.setGlobalPrefix(process.env.GLOBAL_PREFIX ?? '/api/v2');
|
||||||
|
|
||||||
await app.listen(8080);
|
await app.listen(process.env.PORT ?? 8080);
|
||||||
}
|
}
|
||||||
bootstrap();
|
bootstrap();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user