vrudikov / typescript-rest-boilerplate Goto Github PK
View Code? Open in Web Editor NEWBoilerplate project for awesome typescript-rest(https://github.com/thiagobustamante/typescript-rest) library
License: MIT License
Boilerplate project for awesome typescript-rest(https://github.com/thiagobustamante/typescript-rest) library
License: MIT License
$ 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?
Hi,
Could you tell me how to nodemon watch ts files changes as well as running npm run swagger with each change so the apis are always auto generated?
Thanks
How do I set Cors for this application? Any Example would be useful. Thanks. I tried using express-cors but it seems to be not working as expected.
Is this used anywhere inside this or typescript-rest-swagger?
I just tried checking out master and starting this project up using the commands in the readme.
npm install
./build.sh
docker-compose up
And I got an error from the api server:
typescript-rest-boilerplate_1 | Error starting server: Unexpected token export
I didn't make any local modifications or anything so I'm not sure why it wouldn't work. I'm on a mac with macos v10.12.6, npm v5.10.0, node v8.12.0, docker-compose v1.23.2, docker v18.09.2.
Is this something in my environment that is messed up? I can give more information if needed.
I expected npm test
to succeed in a fresh clone of the repo, but it throws lint errors about console.log
and an unnecessary semicolon.
$ git clone https://github.com/vrudikov/typescript-rest-boilerplate && cd typescript-rest-boilerplate && npm install && npm run swagger && npm run test
Cloning into 'typescript-rest-boilerplate'...
[...]
> [email protected] lint /home/alling/typescript-rest-boilerplate
> tslint ./src/**/*.ts ./test/**/*.ts
ERROR: src/controller/hello-admin-controller.ts:34:9 - Calls to 'console.log' are not allowed.
ERROR: src/model/admin.ts:11:2 - Unnecessary semicolon
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] lint: `tslint ./src/**/*.ts ./test/**/*.ts`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] lint 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! /home/alling/.npm/_logs/2020-03-04T09_44_56_409Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] pretest: `cross-env NODE_ENV=test npm run build && npm run lint`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] pretest 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! /home/alling/.npm/_logs/2020-03-04T09_44_56_421Z-debug.log
Hi, do you have plans to support generating existing REST to GraphQL schema like you have already for Swagger? Awesome project, by the way. Thanks!
C:\code\typescript-rest-boilerplate>npm start
[email protected] 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! [email protected] start: ts-node src/index.ts
npm ERR! Exit status 4294967295
npm ERR!
npm ERR! Failed at the [email protected] 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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.