Edge node-express api using Docker, Typescript, codeship & mongoose
I've recently been busy refactoring our api build for Hunteed and the result looks like it could be open-sourced.
So Here it is, an edge-build for developing a node-express api using modern tools such as Docker, @typescriptlang, @codeship, mocha
git clone https://github.com/aherve/typescript-express-docker.git
Some of the cool features it provides :
- Following the spirit of this post : we have a one-click install of the whole environment. Don't worry about mongodb, npm, or anything else, just run docker-compose up and you're ready to work.
- Whole project uses typescript. And typescript validation is just awesome. Try adding some typos to your code and see the console warn you instantly:
In my opinion, there is no coming back to javascript once you tried typescript. It just makes development & maintenance several times faster, while ensuring preventing MANY runtime bugs.
- No messing with babel anymore. Neither to run mocha, your local or remote server. Typescript compiles everything into good old es2015 code that you can use about everywhere
- No more callback hell :
- mocha Unit tests are launched at each change. They are written in the cool ES7-like syntax, but are run against transpiled js code. I particularly like this await syntax:
- Continuous testing: Easy as pie : we use docker to build our app and run a local server. Codeship can run the exact same container to run the tests so there is no discrepancy between the different environments. Almost no additional work to do, and you can browse the result anytime you like:
Hope you like it :)
Hacker Noon is how hackers start their afternoons. We’re a part of the @AMI family. We are now accepting submissions and happy to discuss advertising & sponsorship opportunities.
If you enjoyed this story, we recommend reading our latest tech stories and trending tech stories. Until next time, don’t take the realities of the world for granted!