crystal-lucky

Crystal Lucky Framework

crystal_lucky

This is a project written using Lucky. Enjoy!

Setting up the project

  1. Install required dependencies
  2. Update database settings in config/database.cr
  3. Run script/setup
  4. 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

  1. 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.
  2. Overmind is used as the process manager.

API

$ curl -X POST -H 'content-type: application/json' -d '{"user":{"email": "john.doe@mail.com", "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
Repository

crystal-lucky

Owner
Statistic
  • 0
  • 0
  • 0
  • 0
  • 6
  • over 3 years ago
  • July 20, 2021
License

Links
Synced at

Sat, 21 Dec 2024 11:13:44 GMT

Languages