{"id":20042198,"url":"https://github.com/creativecuriositystudio/restla","last_synced_at":"2025-03-02T07:16:47.507Z","repository":{"id":94964283,"uuid":"81024933","full_name":"creativecuriositystudio/restla","owner":"creativecuriositystudio","description":"A full-stack Node.js web framework written in TypeScript","archived":false,"fork":false,"pushed_at":"2018-01-12T03:13:15.000Z","size":175,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-12T19:33:53.219Z","etag":null,"topics":["api","framework","koa","node","rest","typescript","web"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/creativecuriositystudio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-05T21:53:37.000Z","updated_at":"2017-06-15T05:43:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"0c74e949-4f69-407c-a403-fb461eb49fe7","html_url":"https://github.com/creativecuriositystudio/restla","commit_stats":{"total_commits":42,"total_committers":5,"mean_commits":8.4,"dds":"0.45238095238095233","last_synced_commit":"ce342f4647b8f14b7f671b87ba2acbf70df03427"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creativecuriositystudio%2Frestla","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creativecuriositystudio%2Frestla/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creativecuriositystudio%2Frestla/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creativecuriositystudio%2Frestla/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/creativecuriositystudio","download_url":"https://codeload.github.com/creativecuriositystudio/restla/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241470401,"owners_count":19968041,"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":["api","framework","koa","node","rest","typescript","web"],"created_at":"2024-11-13T10:49:18.270Z","updated_at":"2025-03-02T07:16:47.498Z","avatar_url":"https://github.com/creativecuriositystudio.png","language":"TypeScript","readme":"# Restla\n\n## Introduction\n\nRestla is a full-stack Node.js web framework written in [TypeScript](http://typescript.org/). It is specifically\ndesigned for developing the backend REST APIs of web applications.\n\nRather than reinvent the wheel, Restla provides a solid foundation that simplifies and integrates existing libraries\ncommonly used in Node.js development. Restla integrates the [Koa](http://koajs.com/) web framework and\n[Squell](https://github.com/creativecuriositystudio/squell), a type-safe wrapper for the [Sequelize](http://docs.sequelizejs.com/en/latest/)\nSQL ORM, to provide a completely promise-driven API that supports the async/await paradigm.\n\nRestla extends Koa 2.x with additional functionality, but Koa's core functionality remains the same.\nThis means you can use any official or third-party Koa middleware with Restla. By default, Restla applications\nhave the following Koa middleware enabled:\n\n* [koa-bodyparser 3.x](https://github.com/koajs/bodyparser)\n* [koa-router 7.x](https://github.com/koajs/bodyparser)\n\n## Features\n\n* All Koa middleware works out of the box with Restla applications.\n* `Resource`, a router that can generate generic REST resource routes from a Squell model.\n  The default functionality can easily be change by extending the `Resource` class.\n* `Auth`, an authentication helper that is backend agnostic (i.e. you could authenticate\n  with a third-party authentication.\n\n## Installation\n\n```\nnpm install --save restla\n```\n\n## Usage\n\n### Error Handling\n\nBy default Restla catches all error during requests, coerces them\ninto `ApplicationError`s if they're not already an application error\nand then sends them to the client with a response similar to:\n\n```json\n{\n  \"message\": \"Some error message\",\n  \"errors\": []\n}\n```\n\nRestla automatically coerces ModelSafe validation errors into a 400 response\nand any authentication errors into 402 responses. Any other unknown errors\nare then turned into 500 errors. The validation error response (400 bad request)\nlooks similar to the above but is populated with error messages for each field:\n\n```json\n{\n  \"message\": \"Validation failed\",\n  \"errors\": [{\n    \"path\": \"name\",\n    \"message\": \"Is required\"\n  }]\n}\n```\n\nIf you hit any errors you should reject (or throw if you're using the async keyword) with an an `ApplicationError`\nin your route or resource. It takes a status code and error message like so:\n\n```typescript\nthrow new ApplicationError(404, 'Not Found');\n```\n\nRestla will automatically catch any rejected errors and send them using the `ApplicationContext`'s error method.\nYou can provide your own error response handling method by passing in a custom `ApplicationContext` when instantiating\na Restla application.\n\n## Documentation\n\nThe API documentation generated using [TypeDoc](https://github.com/TypeStrong/typedoc)\nis [available online](http://creativecuriosity.github.io/restla).\n\nTo generate API documentation from the code into the `docs` directory, run:\n\n```sh\nnpm run docs\n```\n\n## Testing\n\nFirst install the library dependencies and the SQLite3 library:\n\n```\nnpm install\nnpm install sqlite3\n```\n\nTo execute the test suite using SQLite as the backend, run:\n\n```\nnpm run test\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreativecuriositystudio%2Frestla","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcreativecuriositystudio%2Frestla","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreativecuriositystudio%2Frestla/lists"}