What's new in GNU Artanis 0.4.1

Today I released GNU Artanis 0.4.1. GNU Artanis is the product level Web Framework for Scheme programming language. Please see the release note for better description.

So what's new?

RESTful API generator

Nowadays, the industry people use Web Framework for RESTful API. The API should be managed by its version. Of course we can add version number in controller in MVC, but it's not so convenient. In 0.4.1, we provide API generator. Currently, we only support RESTful API, but it's not limited to RESTful style API. The module is extensible.

A new "art api" command was added, and the usage is explicit:

art api -c -v v1

You may ignore "-v v1" option, since the default version is "v1", and it will mention you if there's existing version.

After this command, an API file will be generated:

creating   restful API v1
create     app/api/v1.scm

The generated "app/api/v1.scm" looks like this:

;; RESTful API v1 definition of tt
;; Please add your license header here.
;; This file is generated automatically by GNU Artanis.
(define-restful-api v1) ; DO NOT REMOVE THIS LINE!!!

"define-restful-api" is a macro that pre-defined many things. Now you may use "api-define" to define you preferred API:

(api-define
  hello
  (lambda (rc) "hello"))

Please notice that you should visit "v1/hello":

curl localhost:3000/v1/hello

For more details, please checkout out the manual.

If you're interested in GNU Artanis, you may get it for a quick start with docker, please read Install GNU Artanis with Docker.

Happy hacking!