Simple-API v0.1

Many moons ago I released a Node.js tool called Simple-API. Simple-API is a "A Node.js API Scaffolding Library"; essentially that means that Simple-API makes it incredibly easy to quickly build an API in Node.js. I use it for all of my own development, and have found it to be incredibly quick and useful.

Today I'm releasing version 0.1. This version comes with a number of bug fixes, as well as a few major feature additions.



  • Added HTTP response convenience functions
  • Route's now accept strings for the path as well as arrays. (This is a breaking change. The pieces key has changed to path)
  • Added before hook to API object, so you can run some code before each API request. This hook allows you to return false and skip the API action (goes to fallback).

Bug Fixes

  • URLs with GET parameters will now be matched with the correct route
  • Controller helper functions are now run in the correct scope, so that this refers to the controller

I'm sure that, if you're interested in Simple-API, you're probably wondering what the status of Models is. I'm beginning to get into a groove with how I like to use models with Simple-API, and will likely include an implementation in the next version. My goal is for models to be database-agnostic, but to not have all the flack of an ORM. They will likely function similar to controller actions in that you write most of the functionality for the model, and Simple-API just connects all the important pieces.

Big shout out to Jesse Pollak from Clef. Only one of these changes was my idea - most of them are due to his awesome feedback. Thanks Jesse!

Thanks for reading by . Want to read more?
comments powered by Disqus