This repo is a demo for our presentation on building modern functional & fluent CFML REST APIs.
Just use CommandBox and install them: box install
The database needed for this is MySQL 5.7+ or 8+. The SQL file for this project is located in the /workbench/database
folder. Please use that to seed your database, and call the database fluentAPI for consistency with the .env.example
file provided or you can use our migrations.
First create the database fluentapi
in your MySQL database and get some credentials ready for storage:
# Seed your .env file with your db and credentials
dotenv populate
# reload the shell so the credentials are loaded
reload
# run our migrations
migrate up
Once you have your .env
, your db loaded, and your box.json
dependencies installed, you can start your server.
# Adobe
run-script start:adobe
run-script start:lucee
Apart from hitting the root of the site, which is an API echo response, there are lots of things you can do with this app
- List rants: http://127.0.0.1:60146/api/v6/rants
- Create Rants
- Read Rants
- Update Rants
- Delete Rants
http://127.0.0.1:60146/tests/runner.cfm
http://127.0.0.1:60146/cbswagger
- Immport into Insomnia: https://insomnia.rest/
- Import into Postman: https://www.postman.com/
- Use with Swagger.io site: https://editor.swagger.io/