{"id":13424458,"url":"https://github.com/samueleaton/raze","last_synced_at":"2025-03-15T18:35:04.261Z","repository":{"id":92975615,"uuid":"86869687","full_name":"samueleaton/raze","owner":"samueleaton","description":"Modular, light web framework for Crystal","archived":true,"fork":false,"pushed_at":"2021-01-02T01:20:02.000Z","size":3958,"stargazers_count":176,"open_issues_count":9,"forks_count":6,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-10-26T23:55:15.468Z","etag":null,"topics":["crystal"],"latest_commit_sha":null,"homepage":"https://razecr.com/","language":"Crystal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samueleaton.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-04-01T00:11:00.000Z","updated_at":"2024-10-19T23:19:53.000Z","dependencies_parsed_at":"2023-03-10T11:15:24.082Z","dependency_job_id":null,"html_url":"https://github.com/samueleaton/raze","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samueleaton%2Fraze","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samueleaton%2Fraze/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samueleaton%2Fraze/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samueleaton%2Fraze/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samueleaton","download_url":"https://codeload.github.com/samueleaton/raze/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243775846,"owners_count":20346275,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crystal"],"created_at":"2024-07-31T00:00:54.612Z","updated_at":"2025-03-15T18:34:59.242Z","avatar_url":"https://github.com/samueleaton.png","language":"Crystal","funding_links":[],"categories":["Crystal","Web Frameworks"],"sub_categories":[],"readme":"\u003cbr\u003e\n\u003cbr\u003e\n\u003cp align=\"center\"\u003e\n\u003cimg width=\"250\" title=\"raze\" alt=\"raze\" src=\"https://raw.githubusercontent.com/samueleaton/design/master/raze-hero.png\"\u003e\n\u003c/p\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\n# Raze\n\n\u003e Raze for days.\n\n## NOTICE: I am archiving this project. I have since built something even better which I've been using for a couple years (However, it isn't open sourced)\n\nRaze is a lightweight HTTP framework with a focus on building APIs and containerized services. If you want a more general purpose framwork with static file serving, check out [Kemal](https://github.com/kemalcr/kemal).\n\n## Installation\n\nAdd this to your application's `shard.yml`:\n\n```yaml\ndependencies:\n  raze:\n    github: samueleaton/raze\n```\n\n## Usage\n\n```ruby\nrequire \"raze\"\n\nget \"/hello\" do |ctx|\n  \"hello, world!\"\nend\n\nRaze.run\n```\n\n\nRaze takes a modular-first approach to middlewares\n\n```ruby\nrequire \"raze\"\n\n# Define middlewares\nclass Authenticator \u003c Raze::Handler\n  def call(ctx, done)\n    puts \"Authenticate here...\"\n    done.call\n  end\nend\n\nclass DDoSBlocker \u003c Raze::Handler\n  def call(ctx, done)\n    puts \"Prevent DDoS attack here...\"\n    done.call\n  end\nend\n\nclass UserFetcher \u003c Raze::Handler\n  def call(ctx, done)\n    # Fetch user record from DB here...\n    ctx.state[\"user_name\"] = \"Sam\"\n    done.call\n  end\nend\n\n# Define routes, attach middlewares\nget \"/api/**\", [Authenticator.new, DDoSBlocker.new]\n\nget \"/api/user/:user_id\", UserFetcher.new do |ctx|\n  \"hello, #{ctx.state[\"user_name\"]}!\"\nend\n\nRaze.run\n```\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n### TODO\n\n####  Core\n\n- [ ] Be able to run a stack of middlewares before the static file handler\n- [ ] Remove all global scoping (e.g. `get \"/\"` -\u003e `Raze.get \"/\"`)\n- [ ] Live reload functionality for development\n- [ ] Be able to define middlewares globally (for all routes)\n\n#### Middlewares\n\n- [ ] Urlencoded and JSON body parser\n- [ ] Multipart/form-data body parser\n- [ ] Static asset caching\n  - should take a cache time interval and be able to take a path match regex\n- [ ] Route caching\n  - be able to cache the response for a route for a predetermined time interval\n- [ ] Favicon caching\n- [ ] CORS response header\n- [ ] Access logger\n- [ ] Session tracking\n- [ ] Proxy middleware\n- [ ] Security Headers\n  - e.g. Node's [Helmet](https://www.npmjs.com/package/helmet)\n\n## Contributors\n\n- [Sam Eaton](https://github.com/samueleaton) - creator, maintainer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamueleaton%2Fraze","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamueleaton%2Fraze","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamueleaton%2Fraze/lists"}