rest api

Building microservices with Akka HTTP and MongoDB

It's been a while since my last post, but, here I am again. You probably know that both Akka HTTP and MongoDB Scala Driver are reactive, so, they're a good way to go when we talk about highly scalable microservices, and, since I've playing with both lately, I guess it's fair to show a simple REST application using them. Also, this example uses Fongo, a fake in memory MongoDB written in Java, to help us create our tests and not worry with our database access. Well, let's start then. build.…

Keep reading

The basic you should know before building your REST api

There is no recipe to build a REST api, but, there are a lot of good practices that could be followed, so, I gathered the most used and well accepted practices that you should know before building yours. Index Most commonly used HTTP methods GET POST PUT PATCH DELETE Most commonly used HTTP status Don't use verbs in the resource uri Always use JSON as the content-type Envelop your response Make client-side errors well explained in the response Support versioning, but avoid to use it Support async and callback operations…

Keep reading