Getting started

Create a new project

To create a new Puro application, first install Puro Command-line Interface on your system:

$ yarn global add @puro/cli

Once installed, you can create a new project by running:

$ puro create-project <targetDir>

Move to the target directory and create a new configuration file from the existing template:

$ cp config/params.json.dist config/params.json

Make sure to have installed the right database driver accordingly with the TypeORM's documentation.

Finally you can launch the application with:

$ yarn migrate
$ yarn start

And trying it out with your client:

$ curl \
  -X POST \
  -H 'Content-Type: application/json' \
  -d '{ "title": "Title 1", "description": "Description 1" }' \
  --fail \
  http://127.0.0.1:8080/api/books
{
  "status": 201,
  "content": "The book has been created."
}

Last updated