Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit 3914778

Browse files
chore: add wildcard matching for models endpoints
1 parent 68f84fb commit 3914778

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

cortex-js/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
"test:cov": "jest --coverage",
2626
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
2727
"test:e2e": "jest --config ./test/jest-e2e.json",
28-
"typeorm": "typeorm-ts-node-esm"
28+
"typeorm": "typeorm-ts-node-esm",
29+
"build:dev": "npx nest build && chmod +x ./dist/src/command.js && npm link"
2930
},
3031
"dependencies": {
3132
"@huggingface/gguf": "^0.1.5",

cortex-js/src/infrastructure/controllers/models.controller.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export class ModelsController {
5757
required: true,
5858
description: 'The unique identifier of the model.',
5959
})
60-
@Post(':modelId/start')
60+
@Post(':modelId(*)/start')
6161
startModel(
6262
@Param('modelId') modelId: string,
6363
@Body() settings: ModelSettingParamsDto,
@@ -80,7 +80,7 @@ export class ModelsController {
8080
required: true,
8181
description: 'The unique identifier of the model.',
8282
})
83-
@Post(':modelId/stop')
83+
@Post(':modelId(*)/stop')
8484
stopModel(@Param('modelId') modelId: string) {
8585
return this.modelsUsecases.stopModel(modelId);
8686
}
@@ -100,7 +100,7 @@ export class ModelsController {
100100
required: true,
101101
description: 'The unique identifier of the model.',
102102
})
103-
@Get('download/:modelId')
103+
@Get('download/:modelId(*)')
104104
downloadModel(@Param('modelId') modelId: string) {
105105
return this.modelsUsecases.downloadModel(modelId);
106106
}
@@ -137,7 +137,7 @@ export class ModelsController {
137137
required: true,
138138
description: 'The unique identifier of the model.',
139139
})
140-
@Get(':id')
140+
@Get(':id(*)')
141141
findOne(@Param('id') id: string) {
142142
return this.modelsUsecases.findOne(id);
143143
}
@@ -157,7 +157,7 @@ export class ModelsController {
157157
required: true,
158158
description: 'The unique identifier of the model.',
159159
})
160-
@Patch(':id')
160+
@Patch(':id(*)')
161161
update(@Param('id') id: string, @Body() updateModelDto: UpdateModelDto) {
162162
return this.modelsUsecases.update(id, updateModelDto);
163163
}
@@ -177,7 +177,7 @@ export class ModelsController {
177177
required: true,
178178
description: 'The unique identifier of the model.',
179179
})
180-
@Delete(':id')
180+
@Delete(':id(*)')
181181
remove(@Param('id') id: string) {
182182
return this.modelsUsecases.remove(id);
183183
}

0 commit comments

Comments
 (0)