Skip to content

Commit 6295ee9

Browse files
feat: move documentation from /docs into root / (#461)
* feat: move documentation from `/docs` into root `/` and remove `/docs` * docs: update documentation links to remove '/docs' path
1 parent c8d07a2 commit 6295ee9

File tree

8 files changed

+14
-45
lines changed

8 files changed

+14
-45
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ The data we used is based on official sources, managed in [**idn-area-data**](ht
3333
3434
## Documentation
3535

36-
Read the latest version of API documentation in the [documentation page](https://idn-area.up.railway.app/docs). This documentation is automatically generated using [`@nestjs/swagger`](https://docs.nestjs.com/openapi/introduction).
36+
Read the latest version of API documentation in the [documentation page](https://idn-area.up.railway.app). This documentation is automatically generated using [`@nestjs/swagger`](https://docs.nestjs.com/openapi/introduction).
3737

38-
> You also can access the documentation in your local machine by running the app (see [Getting Started](#getting-started)) and open http://localhost:3000/docs in your browser.
38+
> You also can access the documentation in your local machine by running the app (see [Getting Started](#getting-started)) and open http://localhost:3000 in your browser.
3939
4040
## Live Demo
4141

docs/README_hi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
3232
## प्रलेखन
3333

34-
[दस्तावेज़ीकरण पृष्ठ](https://idn-area.up.railway.app/docs) में एपीआई दस्तावेज़ का नवीनतम संस्करण पढ़ें। यह दस्तावेज़ [`@nestjs/swagger`](https://docs.nestjs.com/openapi/introduction) का उपयोग करके स्वचालित रूप से तैयार किया जाता है।
34+
[दस्तावेज़ीकरण पृष्ठ](https://idn-area.up.railway.app) में एपीआई दस्तावेज़ का नवीनतम संस्करण पढ़ें। यह दस्तावेज़ [`@nestjs/swagger`](https://docs.nestjs.com/openapi/introduction) का उपयोग करके स्वचालित रूप से तैयार किया जाता है।
3535

36-
> आप ऐप चलाकर ([शुरू करना](#शुरू-करना) देखें) अपने ब्राउज़र में http://localhost:3000/docs खोलकर अपने स्थानीय मशीन में दस्तावेज़ तक पहुंच सकते हैं।
36+
> आप ऐप चलाकर ([शुरू करना](#शुरू-करना) देखें) अपने ब्राउज़र में http://localhost:3000 खोलकर अपने स्थानीय मशीन में दस्तावेज़ तक पहुंच सकते हैं।
3737
3838
## लाइव डेमो
3939

docs/README_id.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ Data yang kami gunakan menggunakan sumber yang resmi, dikelola di repositori [**
3131
3232
## Dokumentasi
3333

34-
Baca versi terbaru dokumentasi API di [halaman dokumentasi](https://idn-area.up.railway.app/docs). Dokumentasi ini dibuat secara otomatis menggunakan [`@nestjs/swagger`](https://docs.nestjs.com/openapi/introduction).
34+
Baca versi terbaru dokumentasi API di [halaman dokumentasi](https://idn-area.up.railway.app). Dokumentasi ini dibuat secara otomatis menggunakan [`@nestjs/swagger`](https://docs.nestjs.com/openapi/introduction).
3535

36-
> Anda juga dapat mengakses dokumentasinya di perangkat lokal Anda dengan menjalankan aplikasi ini (lihat [Memulai](#memulai)) dan buka http://localhost:3000/docs di browser Anda.
36+
> Anda juga dapat mengakses dokumentasinya di perangkat lokal Anda dengan menjalankan aplikasi ini (lihat [Memulai](#memulai)) dan buka http://localhost:3000 di browser Anda.
3737
3838
## Demo
3939

docs/README_ko.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
3232
## 문서
3333

34-
최신 API 문서를 [문서 페이지](https://idn-area.up.railway.app/docs)에서 확인하세요. 이 문서는 자동으로 [`@nestjs/swagger`](https://docs.nestjs.com/openapi/introduction)를 사용하여 생성됩니다.
34+
최신 API 문서를 [문서 페이지](https://idn-area.up.railway.app)에서 확인하세요. 이 문서는 자동으로 [`@nestjs/swagger`](https://docs.nestjs.com/openapi/introduction)를 사용하여 생성됩니다.
3535

36-
> 또한 앱을 실행하고 브라우저에서 http://localhost:3000/docs를 열어 로컬 머신에서 문서에 액세스할 수도 있습니다. (자세한 내용은 [시작하기](#시작하기) 참조)
36+
> 또한 앱을 실행하고 브라우저에서 http://localhost:3000 열어 로컬 머신에서 문서에 액세스할 수도 있습니다. (자세한 내용은 [시작하기](#시작하기) 참조)
3737
3838
## 라이브 데모
3939

docs/README_tl.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ Ang datos na aming ginamit ay batay sa opisyal na pinagkukunan na kinakalagaan s
3131
3232
## Dokumentasyon
3333

34-
Basahin ang pinakabagong bersyon ng dokumentasyon ng API sa [Pahina ng dokumentasyon](https://idn-area.up.railway.app/docs). Ang dokumentasyong ito ay awtomatikong nalilikha gamit ang [`@nestjs/swagger`](https://docs.nestjs.com/openapi/introduction).
34+
Basahin ang pinakabagong bersyon ng dokumentasyon ng API sa [Pahina ng dokumentasyon](https://idn-area.up.railway.app). Ang dokumentasyong ito ay awtomatikong nalilikha gamit ang [`@nestjs/swagger`](https://docs.nestjs.com/openapi/introduction).
3535

36-
> Puwede rin kayong mag-access sa dokumentasyon sa inyong lokal na makina sa pamamagitan ng pagsisimula ng aplikasyon (makita [Pagsisimula](#pagsisimula)) at buksan ang http://localhost:3000/docs sa iyong browser.
36+
> Puwede rin kayong mag-access sa dokumentasyon sa inyong lokal na makina sa pamamagitan ng pagsisimula ng aplikasyon (makita [Pagsisimula](#pagsisimula)) at buksan ang http://localhost:3000 sa iyong browser.
3737
3838
## Live na pagpapakita
3939

src/app.controller.ts

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,6 @@ import { ApiOkResponse, ApiOperation } from '@nestjs/swagger';
33

44
@Controller()
55
export class AppController {
6-
@Get()
7-
@ApiOperation({ description: 'Base route of this API.' })
8-
@ApiOkResponse({
9-
schema: {
10-
type: 'object',
11-
properties: {
12-
statusCode: { type: 'number', example: 200 },
13-
message: { type: 'string' },
14-
version: {
15-
type: 'string',
16-
description: 'The version of this API.',
17-
example: '1.0.0',
18-
},
19-
},
20-
},
21-
})
22-
async index() {
23-
return {
24-
statusCode: HttpStatus.OK,
25-
message: 'Welcome to Indonesia Area API.',
26-
version: process.env.npm_package_version,
27-
docs: '/docs',
28-
};
29-
}
30-
316
@Get('health')
327
@ApiOperation({ description: 'Check the health of this API.' })
338
@ApiOkResponse({

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ async function bootstrap() {
3434
// Create the API documentation.
3535
const doc = SwaggerModule.createDocument(app, docConfig);
3636
// Set the endpoint for API documentation.
37-
const docPath = 'docs';
37+
const docPath = '/';
3838
// Setup the API documentation.
3939
SwaggerModule.setup(docPath, app, doc);
4040

test/app.e2e-spec.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,9 @@ describe('AppController (e2e)', () => {
88
await tester.bootApp();
99
});
1010

11-
it('/ (GET)', async () => {
12-
const res = await tester.expectOk('/');
13-
14-
expect(res.json()).toEqual(
15-
expect.objectContaining({
16-
message: expect.any(String),
17-
version: process.env.npm_package_version,
18-
}),
19-
);
11+
it('/health (GET)', async () => {
12+
const res = await tester.expectOk('/health');
13+
expect(res.json()).toEqual({ statusCode: 200, message: 'OK' });
2014
});
2115

2216
afterAll(async () => {

0 commit comments

Comments
 (0)