Skip to content

reidwagner/hy-flask-rest-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Sample Flask REST tasklist written in Hy

Rewrote in Hy and with sqlite support the app built in this tutorial. Hy is a Lisp dialect that compiles into Python AST.

You'll need to set up a sqlite database in the directory named tasks.db and create this table: CREATE TABLE task(id smallint, title varchar(20), description varchar(200), done smallint);. I will be adding some better db management and setup using SQLAlchemy next!

To run:

./main.py

To try it out:

curl -i -u foo:bar -X GET 127.0.0.1:5000/todo/api/v1.0/tasks
curl -i -u foo:bar -X GET 127.0.0.1:5000/todo/api/v1.0/tasks/1
curl -i -u foo:bar -X POST -H "Content-Type: application/json" 127.0.0.1:5000/todo/api/v1.0/tasks -d '{"title": "buy milk"}'
curl -i -u foo:bar -X PUT -H "Content-Type: application/json" 127.0.0.1:5000/todo/api/v1.0/tasks/2 -d '{"done":true}'
curl -i -u foo:bar -X DELETE 127.0.0.1:5000/todo/api/v1.0/tasks/2

Sources:

About

Tasklist with RESTful API written in Hy using Flask.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published