RockNinja
RockNinja

Reputation: 2309

Build a REST API with no frameworks

I want to build a website with a REST API back-end and angularJs as front-end.

I used frameworks all the time when building something like this, but I never paid to much attention to how those frameworks were built(not a lot of free time).

I have started a new project which will be hosted on Google App Engine, I have built few necessary things like:

  1. Router Handler
  2. Middleware's for checking the Header(content-type) and one which is setting the response writer type, also an errors middleware.
  3. Error file which will contain all the error.

I will need to write few more middleware for an authentication system probably.

What other things need to be present in a REST server?

Upvotes: 0

Views: 1155

Answers (1)

Thierry Templier
Thierry Templier

Reputation: 202286

In fact, it depends on what you want to support for your API ;-) I see things like that:

  • Routing (routes and sub routes, filter and processing chains)
  • Resource path variables (/myresource/{anid}...)
  • Query parameters
  • Conneg (returned content negociation based on the accept header)
  • Support for one or several content types (JSON, XML, ...). A framework like Jackson2 can be useful here (it's painful to implement a complete and efficient bean / structured content conversion)
  • Security (basic, token-based, ...)
  • Error handling

Perhaps these two links can help you for further hints:

Hope it helps. Thierry

Upvotes: 1

Related Questions