PublicApi: Add correct prefix

Using nest-router for this purpose as it is a rather easy addition to our structure. As we don't add the Router to any e2e tests we don't need to change them.

fixes #523

Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
Philip Molares 2021-02-15 10:26:12 +01:00 committed by David Mehren
parent 0366cb491f
commit 698dd1a634
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
3 changed files with 17 additions and 2 deletions

View file

@ -29,12 +29,12 @@
"@nestjs/core": "7.6.12",
"@nestjs/passport": "7.1.5",
"@nestjs/platform-express": "7.6.12",
"@nestjs/swagger": "4.7.13",
"@nestjs/schedule": "0.4.2",
"@nestjs/swagger": "4.7.13",
"@nestjs/typeorm": "7.1.5",
"@types/bcrypt": "3.0.0",
"@types/cron": "1.7.2",
"@types/passport-http-bearer": "1.0.36",
"@types/bcrypt": "3.0.0",
"bcrypt": "5.0.0",
"class-transformer": "0.4.0",
"class-validator": "0.13.1",
@ -42,6 +42,7 @@
"connect-typeorm": "1.1.4",
"file-type": "16.2.0",
"joi": "17.4.0",
"nest-router": "^1.0.9",
"passport": "0.4.1",
"passport-http-bearer": "1.0.1",
"raw-body": "2.4.1",

View file

@ -27,9 +27,18 @@ import databaseConfig from './config/database.config';
import authConfig from './config/auth.config';
import { PrivateApiModule } from './api/private/private-api.module';
import { ScheduleModule } from '@nestjs/schedule';
import { RouterModule, Routes } from 'nest-router';
const routes: Routes = [
{
path: '/api/v2',
module: PublicApiModule,
},
];
@Module({
imports: [
RouterModule.forRoutes(routes),
TypeOrmModule.forRoot({
type: 'sqlite',
database: './hedgedoc.sqlite',

View file

@ -4961,6 +4961,11 @@ neo-async@^2.6.2:
resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f"
integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==
nest-router@^1.0.9:
version "1.0.9"
resolved "https://registry.yarnpkg.com/nest-router/-/nest-router-1.0.9.tgz#cbe814dadf90b765e0a5b77c562479d5d523a485"
integrity sha512-ZyRdSVs9GczI+39B7tNXsxfBXQOYnEF6l/q2aLYG8wSEvRHRDXAlzZ1SIosDibM02pLahGkDNLFC+nZ8uzJGDQ==
next-tick@1, next-tick@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.1.0.tgz#1836ee30ad56d67ef281b22bd199f709449b35eb"