Change local backend port to 3007
This commit is contained in:
parent
98edfa0faf
commit
e5027152ab
@ -1,7 +1,7 @@
|
||||
NODE_ENV=development
|
||||
PORT=3000
|
||||
PORT=3007
|
||||
DATABASE_URL=postgresql://velody:velody@localhost:5432/velody?schema=public
|
||||
STORAGE_ROOT=../runtime/storage
|
||||
PUBLIC_BASE_URL=http://localhost:3000
|
||||
PUBLIC_BASE_URL=http://localhost:3007
|
||||
DEVICE_BOOTSTRAP_SECRET=replace-me
|
||||
MAX_UPLOAD_SIZE_BYTES=524288000
|
||||
|
||||
@ -5,11 +5,11 @@ import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
|
||||
|
||||
async function generate(): Promise<void> {
|
||||
process.env.NODE_ENV ??= 'development';
|
||||
process.env.PORT ??= '3000';
|
||||
process.env.PORT ??= '3007';
|
||||
process.env.DATABASE_URL ??=
|
||||
'postgresql://velody:velody@localhost:5432/velody?schema=public';
|
||||
process.env.STORAGE_ROOT ??= join(process.cwd(), '..', 'runtime', 'storage');
|
||||
process.env.PUBLIC_BASE_URL ??= 'http://localhost:3000';
|
||||
process.env.PUBLIC_BASE_URL ??= 'http://localhost:3007';
|
||||
process.env.DEVICE_BOOTSTRAP_SECRET ??= 'openapi-placeholder-secret';
|
||||
process.env.MAX_UPLOAD_SIZE_BYTES ??= '524288000';
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ export class AppConfigService {
|
||||
}
|
||||
|
||||
get port(): number {
|
||||
return Number(this.required('PORT'));
|
||||
return Number(this.configService.get<string>('PORT') ?? '3007');
|
||||
}
|
||||
|
||||
get databaseUrl(): string {
|
||||
|
||||
@ -4,15 +4,15 @@ describe('validateEnvironment', () => {
|
||||
it('accepts a valid environment', () => {
|
||||
const result = validateEnvironment({
|
||||
NODE_ENV: 'test',
|
||||
PORT: '3000',
|
||||
PORT: '3007',
|
||||
DATABASE_URL: 'postgresql://velody:velody@localhost:5432/velody?schema=public',
|
||||
STORAGE_ROOT: '/tmp/velody',
|
||||
PUBLIC_BASE_URL: 'http://localhost:3000',
|
||||
PUBLIC_BASE_URL: 'http://localhost:3007',
|
||||
DEVICE_BOOTSTRAP_SECRET: 'secret',
|
||||
MAX_UPLOAD_SIZE_BYTES: '1024',
|
||||
});
|
||||
|
||||
expect(result.PORT).toBe(3000);
|
||||
expect(result.PORT).toBe(3007);
|
||||
expect(result.MAX_UPLOAD_SIZE_BYTES).toBe(1024);
|
||||
});
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ class EnvironmentVariables {
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@Max(65535)
|
||||
PORT!: number;
|
||||
PORT: number = 3007;
|
||||
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
|
||||
@ -8,7 +8,7 @@ process.env.DATABASE_URL =
|
||||
process.env.STORAGE_ROOT =
|
||||
process.env.STORAGE_ROOT ?? '/tmp/velody-storage';
|
||||
process.env.PUBLIC_BASE_URL =
|
||||
process.env.PUBLIC_BASE_URL ?? 'http://localhost:3000';
|
||||
process.env.PUBLIC_BASE_URL ?? 'http://localhost:3007';
|
||||
process.env.DEVICE_BOOTSTRAP_SECRET =
|
||||
process.env.DEVICE_BOOTSTRAP_SECRET ?? 'test-secret';
|
||||
process.env.MAX_UPLOAD_SIZE_BYTES =
|
||||
|
||||
Loading…
Reference in New Issue
Block a user