Evolution of a Microservice
- Write a function.
- Put it in a separate file and expose it as a CommonJS module.
- Move the function to it's own Git repo.
- Publish to NPM.
- Put it behind HTTP Service.
Most of the time you don't continue beyond step 2. If the function needs to be shared with other projects, move it to it's own Git repo. Do you need semantic versioning? publish it to NPM. Do you want to consume it over HTTP? set up an HTTP service in front of it.