Skip to content

Commit

Permalink
fix: inline home route
Browse files Browse the repository at this point in the history
  • Loading branch information
njfamirm committed Dec 21, 2022
1 parent a05b1a2 commit ce978f6
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 27 deletions.
3 changes: 1 addition & 2 deletions core/nano-server/src/nano-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,13 @@ export class AlwatrNanoServer {
* const nanoServer = new AlwatrNanoServer();
*
* nanoServer.route('GET', '/', async (connection) => {
* return {
* ok: true,
* data: {
* app: 'Alwatr Nanoservice Starter Kit',
* message: 'Hello ;)',
* },
* };
* });
* );
* ```
*/
constructor(config?: Partial<NanoServerConfig>) {
Expand Down
8 changes: 2 additions & 6 deletions services/comment/src/route/home.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import {AlwatrServiceResponse} from '@alwatr/nano-server';

import {nanoServer} from '../lib/nano-server.js';

nanoServer.route('GET', '/', home);

function home(): AlwatrServiceResponse {
nanoServer.route('GET', '/', () => {
return {
ok: true,
data: {
app: 'Alwatr Comment API Microservice',
message: 'Hello ;)',
},
};
}
});
8 changes: 2 additions & 6 deletions services/starter/src/route/home.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import {nanoServer} from '../lib/nano-server.js';

import type {AlwatrServiceResponse} from '@alwatr/nano-server';

nanoServer.route('GET', '/', home);

function home(): AlwatrServiceResponse {
nanoServer.route('GET', '/', () => {
return {
ok: true,
data: {
app: 'Alwatr Nanoservice Starter Kit',
message: 'Hello ;)',
},
};
}
});
10 changes: 3 additions & 7 deletions services/telegram-notifier/src/route/home.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import {AlwatrServiceResponse} from '@alwatr/nano-server';

import {nanoServer} from '../lib/nano-server.js';

nanoServer.route('GET', '/', home);

function home(): AlwatrServiceResponse {
nanoServer.route('GET', '/', () => {
return {
ok: true,
data: {
app: 'Alwatr Notify Microservice',
app: 'Alwatr Telegram Notify Microservice',
message: 'Hello ;)',
},
};
}
});
8 changes: 2 additions & 6 deletions uniquely/flight-finder-api/src/route/home.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import {AlwatrServiceResponse} from '@alwatr/nano-server';

import {nanoServer} from '../lib/nano-server.js';

nanoServer.route('GET', '/', home);

function home(): AlwatrServiceResponse {
nanoServer.route('GET', '/', () => {
return {
ok: true,
data: {
app: 'Alwatr Flight Finder API Microservice',
message: 'Hello ;)',
},
};
}
});

0 comments on commit ce978f6

Please sign in to comment.