REST API using Node.js
I want to setup a simple REST server that allows to Create, Read, Update and Delete data (Users in this case) using Node.js, Express, and TypeScript:
- I could do it using Java/Spring in a couple of minutes, but I want to learn more about Node.js.
- Express seems to be a good choice to create REST APIs.
- And as I think that TypeScript may be the good compromise between Java and Javascript I will keep on giving it a try.
Also, I would like to feel as comfortable as using Java. First I need a debugger. No need to spam console.log()
using node-inspector.
Then unit tests are mandatory and cannot go without a code coverage tool.
Finally, I make use of various tools to build, test, debug and run the TypeScript code. Grunt is convenient simplify these processes (plus it's a gain for productivity).
The only thing I bypassed is a code quality tool. We use SonarQube on a daily basis for OctoPerf,
and I might do the same for this sample someday.
Before reading this article further, you may check the result on GitHub Rest-Crud.