vrudikov / typescript-rest-boilerplate

Boilerplate project for awesome typescript-rest(https://github.com/thiagobustamante/typescript-rest) library
MIT License
81 stars 45 forks source link

HTTP 404: "Cannot GET /" #22

Open SimonAlling opened 4 years ago

SimonAlling commented 4 years ago
$ git clone https://github.com/vrudikov/typescript-rest-boilerplate
$ cd typescript-rest-boilerplate/
$ npm install
$ npm run swagger
$ npm run build
$ docker-compose up -d

This works fine.

$ docker ps
CONTAINER ID        IMAGE                                                     COMMAND                  CREATED             STATUS              PORTS                      NAMES
2977545f512e        typescript-rest-boilerplate_typescript-rest-boilerplate   "docker-entrypoint.s…"   4 minutes ago       Up 4 minutes        0.0.0.0:3000->3000/tcp     typescript-rest-boilerplate_typescript-rest-boilerplate_1
ce8bbe5d18fe        mongo:latest                                              "docker-entrypoint.s…"   4 minutes ago       Up 4 minutes        0.0.0.0:27017->27017/tcp   typescript-rest-boilerplate_mongo_1

But when I go to http://127.0.0.1:3000 (as suggested under UI Test), I get a 404 response with this body:

Cannot GET /

I expected a clearer indication that the service is up and running; should I?

Bogay commented 3 years ago

In src/api-server.ts, add endpoint: '/' to the options parameter may help.
It will look like this.

Server.swagger(this.app, { endpoint: '/', filePath: './dist/swagger.json' });