You can install the application by following these steps
Open your command line too (CLI) and paste this command into it:
git clone https://github.com/ade555/flask-app-with-neon-serverless.git
In the root directory, create a file called .env
.
Next, copy the variable names in the env_sample
file, and replace the values with your database url and branched database url from Neon.
You can run the project by typing this command in your CLI:
flask --app app run --debug
The project has a single CREATE endpoint.
Base URL: http://127.0.0.1:5000/
- Endpoint:
/add_book/
- HTTP Method:
POST
- Description: Creates a new book in the database.
Parameter | Type | Description | Required |
---|---|---|---|
title | string | Title of the book to create in the database | Yes |
Request Body:
{
"title": "The Lion King"
}
Responses:
201 Created
: Successfully created a new book in the database.400 Bad Request
: Invalid input or malformed request.500 Internal Server Error
: Unexpected server error.