crystal_lucky
This is a project written using Lucky. Enjoy!
Setting up the project
- Install required dependencies
- Update database settings in
config/database.cr
- Run
script/setup
- Run
lucky dev
to start the app
Learning Lucky
Lucky uses the Crystal programming language. You can learn about Lucky from the Lucky Guides.
Installation
- Installation of Crystal is done using asdf version manager. At the time this is written, Lucky framework only supports Crystal v0.36.1, not v1.0.x.
- Overmind is used as the process manager.
API
$ curl -X POST -H 'content-type: application/json' -d '{"user":{"email": "[email protected]", "password": "123456", "password_confirmation":"123456"}}' http://127.0.0.1:5000/api/sign_ups
{"token":<generated_token>}%
# Visit
http://127.0.0.1:5000/api/me?auth_token=<generated_token>
Creating a new model
$ lucky gen.model Post
$ lucky db.migrate
API
$ curl -X POST -H 'content-type: application/json' -d '{"post":{"body": "hello world"}}' http://127.0.0.1:5000/api/posts
{"id":"7cb6e887-cce5-4584-a7e0-fbbecaaf312e","body":"hello world"}%
# Visit
http://127.0.0.1:5000/api/posts