Bingo meetings–deploying to heroku–part 19


Bingo is a small project, written in TypeScript , and developed with Alexandru Badita in launch break (one hour - more or less). You can find sources at . Those are my blog posts for Bingo : ( scroll below for the post)
1Create meeting
2Create Tests
3Finalize Create meeting
4Sharing meeting
5Keep Score
6Add obsolete
7Finalizing obsolete
8End meeting
9Dockerize tests
10Azure CI tests
11Yarn workspaces
13Intermezzo - CLI improvements
14typescript compile run with node
15NestJS ,swagger and create a meeting
16Finalizing API
17Intermezzo - jest vs jasmine error
18Refactor WebAPI and test service
19Heroku Deploy NestJs
21Deploy Angular to GitHub
22WebAPI and Web
24Documentation of the code

We have decided to deploy on heroku, since it has some free dynos. Heroku is integrated with GitHub and has “automatic deploys” – that means that every push will automatically deploy to Heroku. That will be an opportunity for AzureDevOps to verify correct deploy ( even if appears different …)

Some points here:

1. Heroku is calling web npm start . So  in the root of the project we should have a package.json with a start script that starts our api

“start”: “cd bingo-cards-api && yarn start”,

2. Heroku is stripping dev dependecies. So, if you did not compile the project – and want too use tsc or other dependemcies, you should add on Heroku site the setting  NPM_CO NFIG_PRODUCTION false

3. The swagger from nestjs is , somehow, calling the HTTP, not the HTTPS . So the does not work, but works

4.Because we can call from other sites, the CORS should be enabled .


5. Also , we should enable dynamic port for Heroku

const port: string = process.env.PORT || “3000”;
await app.listen(parseInt(port, 10));


After this, you can try the API at