{"id":19232629,"url":"https://github.com/makeomatic/restify-utils","last_synced_at":"2025-07-28T12:44:22.527Z","repository":{"id":57355095,"uuid":"46718349","full_name":"makeomatic/restify-utils","owner":"makeomatic","description":"Convenience methods for Restify HTTP server","archived":false,"fork":false,"pushed_at":"2017-04-28T20:45:19.000Z","size":112,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-02-05T15:51:30.792Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/makeomatic.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}},"created_at":"2015-11-23T12:19:27.000Z","updated_at":"2016-01-13T14:34:10.000Z","dependencies_parsed_at":"2022-08-28T13:21:21.156Z","dependency_job_id":null,"html_url":"https://github.com/makeomatic/restify-utils","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makeomatic%2Frestify-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makeomatic%2Frestify-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makeomatic%2Frestify-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makeomatic%2Frestify-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/makeomatic","download_url":"https://codeload.github.com/makeomatic/restify-utils/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240310872,"owners_count":19781341,"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":[],"created_at":"2024-11-09T16:06:57.109Z","updated_at":"2025-02-23T11:40:26.035Z","avatar_url":"https://github.com/makeomatic.png","language":"JavaScript","readme":"# Restify Utils\n\n## Install\n\n`npm i restify-utils -S`\n\n## Usage\n\n### Main function\n\n`const attach = require('restify-utils')(configuration, endpointsDir, middlewareDir)`\n\nreturns Function:\n\n1. Function(server, family, prefix = '/api') with extra properties:\n2. endpoints\n3. middleware\n\nPopulates `configuration.models`\n\nGoes through endpoints, that are in format of the following:\n\n```js\nexports.VERB = {\n  path: '/path/relative/to/prefix/family',\n  middleware: [ 'middlewareName' ],\n  handlers: {\n    '1.0.0': function handler(req, res, next) {\n\n    },\n    '1.1.0': function xxx(req, res, next) {\n\n    }\n  },\n};\n```\n\nIt will be attached to `VERB ${prefix}/${family}/path/relative/to/prefix/family` with 2 versions: 1.0.0 and 1.1.0\n\n### Endpoints, middleware, models\n\n1. Models - instances of classes in the models folder:\n\n  * User\n\n2. Endpoints - endpoints from the endpointsDir\n3. Middleware - middleware from the middlewareDir\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakeomatic%2Frestify-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmakeomatic%2Frestify-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakeomatic%2Frestify-utils/lists"}