Recent Posts

Writing a Simple REST Web Service in PureScript - Part 2

Posted on October 1, 2017 by Abhinav Sarkar
Tags: purescript, REST, programming, nilenso
21 minute read

To recap, in the first part of this two-part tutorial, we built a simple JSON REST web service in PureScript to create, update, get, list and delete users, backed by a Postgres database. In this part we’ll work on the rest of the requirements:

  1. validation of API requests.
  2. reading the server and database configs from environment variables.
  3. logging HTTP requests and debugging info.
Read more

Writing a Simple REST Web Service in PureScript - Part 1

Posted on September 29, 2017 by Abhinav Sarkar
Tags: purescript, REST, programming, nilenso
23 minute read

At Nilenso, we’ve been working with a client who has chosen PureScript as their primary programming language. Since I couldn’t find any canonical documentation on writing a web service in PureScript, I thought I’d jot down the approach that we took.

The aim of this two-part tutorial is to create a simple JSON REST web service written in PureScript, to run on a node.js server. This assumes that you have basic proficiency with PureScript. We have the following requirements:

  1. persisting users into a Postgres database.
  2. API endpoints for creating, updating, getting, listing and deleting users.
  3. validation of API requests.
  4. reading the server and database configs from environment variables.
  5. logging HTTP requests and debugging info.

In this part we’ll work on setting up the project and on the first two requirements. In the next part we’ll work on the rest of the requirements.

Read more

Check the archive for more posts.