server
Version, currently master branch1 version
- master branchlatestAug 2, 2020
github.com/mkdika/kemal-rest-api
Simple REST API example with Kemal
7 stars
0 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
server:
github: mkdika/kemal-rest-api
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
0.34.0- License
- MIT
- Author
- Maikel Chandika
- Target
serverfrom src/server.cr
Dependencies
Runtime Dependencies
- pg*github: will/crystal-pg
- kemal*github: kemalcr/kemal
- crecto*github: Crecto/crecto
- micrate*github: amberframework/micrate
- spec-kemal*github: kemalcr/spec-kemal
README
Kemal REST API
Simple REST API example with Kemal micro web framework, in CRUD use cases.
Features
- Crecto, Database wrapper and ORM for Crystal.
- Micrate, database migration tool for Crystal.
- Database use PostgreSQL.
- Test specs example.
Endpoints
| HTTP Method | Path | Description |
|---|---|---|
| GET | /api/customers | Get all existing customer data |
| GET | /api/customers/:id | Get existing customer data by Id |
| POST | /api/customers | Insert new customer data |
| PUT | /api/customers/:id | update existing customer data by Id |
| DELETE | /api/customers/:id | Delete existing customer data by Id |
Build and run on local
Install Crystal language.
# Clone the project
git clone https://github.com/mkdika/kemal-rest-api.git
cd kemal-rest-api/
# Install related dependencies
shards install
# create environment variable, you can adjust your db connection string
export DB_URL='postgres://postgres:postgres@localhost:5432/kemal_rest_api'
# Run db setup (create db & run migrations)
crystal run src/util/db_setup.cr
# Run all test specs
crystal spec
# Build binary
shards build --production --release
# run the app
./bin/server
# output: [development] Kemal is ready to lead at http://0.0.0.0:3000
# Optionally, run kemal in `production` environmen & custom port
KEMAL_ENV=production ./bin/server 80
# output: [production] Kemal is ready to lead at http://0.0.0.0:80
Contributing
- Fork it (https://github.com/mkdika/kemal-rest-api/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Maikel Chandika - creator and maintainer
Copyright and License
Copyright 2020 Maikel Chandika (mkdika@gmail.com). Code released under the MIT License. See LICENSE file.
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- Aug 2, 2020
- Crystal
0.34.0- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/mkdika/kemal-rest-api
Metadata
- Created
- Aug 12, 2026
- Updated
- Nov 10, 2026
- Synced
- Nov 4, 2026
- Versions
- 1