Skip to content

Commit

Permalink
chore(JavaScript/ditsmod): upgrade to v3.
Browse files Browse the repository at this point in the history
  • Loading branch information
KostyaTretyak committed Dec 24, 2024
1 parent 2eac55b commit bdc1447
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion javascript/ditsmod-bun/config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
framework:
github: ditsmod/ditsmod
website: ditsmod.github.io/en
version: 2.61
version: 3

engines:
- bun
Expand Down
6 changes: 3 additions & 3 deletions javascript/ditsmod-bun/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"author": "Your Name Here",
"license": "MIT",
"dependencies": {
"@ditsmod/body-parser": "~2.17.1",
"@ditsmod/core": "~2.61.1",
"@ditsmod/routing": "~2.7.0"
"@ditsmod/body-parser": "^3.0.0-alpha.2",
"@ditsmod/core": "^3.0.0-alpha.2",
"@ditsmod/routing": "^3.0.0-alpha.2"
},
"devDependencies": {
"@types/node": "^22.9.0",
Expand Down
2 changes: 1 addition & 1 deletion javascript/ditsmod/config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
framework:
github: ditsmod/ditsmod
website: ditsmod.github.io/en
version: 2.61
version: 3

bootstrap:
- npm install
Expand Down
6 changes: 3 additions & 3 deletions javascript/ditsmod/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"author": "Your Name Here",
"license": "MIT",
"dependencies": {
"@ditsmod/body-parser": "~2.17.1",
"@ditsmod/core": "~2.61.1",
"@ditsmod/routing": "~2.7.0"
"@ditsmod/body-parser": "^3.0.0-alpha.2",
"@ditsmod/core": "^3.0.0-alpha.2",
"@ditsmod/routing": "^3.0.0-alpha.2"
},
"devDependencies": {
"@types/node": "^22.9.0",
Expand Down
11 changes: 6 additions & 5 deletions javascript/ditsmod/src/app/hello-world.controller.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
import { controller, SingletonRequestContext, route } from '@ditsmod/core';
import { controller, SingletonRequestContext } from '@ditsmod/core';
import { route } from '@ditsmod/routing';

@controller({ isSingleton: true })
@controller({ scope: 'module' })
export class HelloWorldController {
@route('GET')
empty(ctx: SingletonRequestContext) {
ctx.nodeRes.end();
ctx.rawRes.end();
}

@route('GET', 'user/:id')
userId(ctx: SingletonRequestContext) {
ctx.nodeRes.end(ctx.pathParams!.id);
ctx.rawRes.end(ctx.pathParams!.id);
}

@route('POST', 'user')
postHello(ctx: SingletonRequestContext) {
ctx.nodeRes.end();
ctx.rawRes.end();
}
}
2 changes: 1 addition & 1 deletion javascript/ditsmod/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ import type { ServerOptions } from 'node:http';
import { AppModule } from './app/app.module.js';

const serverOptions: ServerOptions = { keepAlive: true, keepAliveTimeout: 0 };
const app = await new Application().bootstrap(AppModule, { serverOptions });
const app = await Application.create(AppModule, { serverOptions });
app.server.listen(3000, '0.0.0.0');

0 comments on commit bdc1447

Please sign in to comment.