vrudikov / typescript-rest-boilerplate

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

cannot npm start #15

Open mariomuja opened 5 years ago

mariomuja commented 5 years ago

I cloned the repo and called npm install - however, I cannot npm start. Can you help me? Regards, Mario

C:\code\typescript-rest-boilerplate>npm start

typescript-rest-boilerplate@0.0.1 start C:\code\typescript-rest-boilerplate ts-node src/index.ts

Error starting server: C:\code\typescript-rest-boilerplate\dist\swagger.json: ENOENT: no such file or directory, open 'C:\code\typescript-rest-boilerplate\dist\swagger.json' npm ERR! code ELIFECYCLE npm ERR! errno 4294967295 npm ERR! typescript-rest-boilerplate@0.0.1 start: ts-node src/index.ts npm ERR! Exit status 4294967295 npm ERR! npm ERR! Failed at the typescript-rest-boilerplate@0.0.1 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\MMU\AppData\Roaming\npm-cache_logs\2019-08-23T09_30_04_981Z-debug.log

ad0bert commented 5 years ago

First you have to generate the swagger spec: Swagger Docs Generation npm run swagger

This may not work because of an issue I already fixed in my open pull request

vrudikov commented 5 years ago

Merged your PR @ad0bert. But I need double check your solution with switch to interfaces in future.

mariomuja commented 5 years ago

I did a npm run swagger and now I get the following output. It seemed to help but it tries to access port 27017 althogh the service should listen at port 3000. Hmmm... do you have a clue?

PS C:\code\typescript-rest-boilerplate> npm run swagger

typescript-rest-boilerplate@0.0.1 swagger C:\code\typescript-rest-boilerplate swaggerGen -c ./swagger.config.yml

Generation completed. PS C:\code\typescript-rest-boilerplate> npm start

typescript-rest-boilerplate@0.0.1 start C:\code\typescript-rest-boilerplate ts-node src/index.ts

Listening to http://127.0.0.1:3000 Error starting server: connect ECONNREFUSED 127.0.0.1:27017 npm ERR! code ELIFECYCLE npm ERR! errno 4294967295 npm ERR! typescript-rest-boilerplate@0.0.1 start: ts-node src/index.ts npm ERR! Exit status 4294967295 npm ERR! npm ERR! Failed at the typescript-rest-boilerplate@0.0.1 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\MMU\AppData\Roaming\npm-cache_logs\2019-09-13T10_40_02_629Z-debug.log

mariomuja commented 5 years ago

ah I see - it is the Mongo DB that wants to run on 27017

do not like your approach to make the only quick start example so complicated.. why don't you concentrate on showing the features of typescript-rest without involving Mongo, Swagger and other things, which make the whole thing more complex and difficult to understand

I am now trying for 3 weeks !!! and could not manage to get a simple example with typescript-rest up and running. Do you have some 10 lines to demonstrate typescript-rest which are working fine and do not have dependencies to other products?

vrudikov commented 5 years ago

Just take nestjs. It has all you need and it's much easier to run

mariomuja commented 5 years ago

thanks but at the moment I do not have a need to run any tests - I just want to have some typescript code with a rest interface and thought that typescript-rest can make that a little bit easier

vrudikov commented 5 years ago

you can easily disable Mongo integration

mariomuja commented 5 years ago

"you can easily disable Mongo integration" how? mongo and the "hello-admin-controller" is referenced in several files in this repo... it is not just an easy switch - i think, I would have to remove the controller, mongo and all references to it - this repository is far too complicated - wants to be a "integrate everything needed" example and thereby leading away from the simplicity of defining a REST api just by using some decorators - THIS is what the example should demonstrate and not the advantages of Mongo, unit tests, IoC pattern and all the other things that you can find in this repo - separation of concerns - concentrate on the matter and leave everything else away - otherwise it get's unmanageable and nobody will use it