{"id":19938075,"url":"https://github.com/dweinstein/types-endpoint","last_synced_at":"2026-05-09T23:03:18.022Z","repository":{"id":30087408,"uuid":"33637045","full_name":"dweinstein/types-endpoint","owner":"dweinstein","description":"share schema types on an endpoint compatible with restify, express, endpointer","archived":false,"fork":false,"pushed_at":"2015-04-09T00:00:00.000Z","size":116,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-12T11:46:00.748Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dweinstein.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-08T23:08:44.000Z","updated_at":"2015-04-09T00:00:01.000Z","dependencies_parsed_at":"2022-09-14T00:52:14.308Z","dependency_job_id":null,"html_url":"https://github.com/dweinstein/types-endpoint","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dweinstein%2Ftypes-endpoint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dweinstein%2Ftypes-endpoint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dweinstein%2Ftypes-endpoint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dweinstein%2Ftypes-endpoint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dweinstein","download_url":"https://codeload.github.com/dweinstein/types-endpoint/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241367127,"owners_count":19951440,"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-12T23:38:19.506Z","updated_at":"2025-11-26T02:06:26.791Z","avatar_url":"https://github.com/dweinstein.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SYNOPSIS\n\nReturn a convenient endpoint suitable for\n[restify](https://github.com/mcavage/node-restify),\n[endpointer](https://github.com/ekristen/endpointer), that returns schema types\nfor the type name requests.\n\n# USAGE\n\n```\nnpm i types-endpoint\n\n```\n\n# EXAMPLE\n\n```javascript\nvar jsonschema = require('jsonschema');\nvar Validator = require('jsonschema').Validator;\nvar v = new Validator();\n\n// add some types to the scheme\nv.addSchema({\n  id: \"/type/name\",\n  type: \"string\",\n  title: \"name of something\"\n  }, \"/type/name\"\n);\n\n// create our endpoint for the schema types\nvar ep = require('types-endpoint')(v);\n\n// create the server...\nvar restify = require('restify');\nvar server = restify.createServer({\n  name: 'myapp',\n  version: '1.0.0'\n});\nserver.use(restify.acceptParser(server.acceptable));\nserver.use(restify.queryParser());\nserver.use(restify.bodyParser());\n\n// wire up endpoint for restify\nserver.get(ep.path, ep.handler);\n\n// OR with endpointer\nvar endpoints = new Endpointer();\nendpoints.addEndpoint(ep);\nendpoints.attach(server)\n\n// listen on port\nserver.listen(8080)\n```\n\n```\n% curl -i http://localhost:3000/_types/foo\nHTTP/1.1 404 Not Found\nContent-Type: application/json\nContent-Length: 11\nDate: Wed, 08 Apr 2015 23:02:22 GMT\nConnection: keep-alive\n\n\"not found\"%``\n```\n\n```\n% curl -i http://localhost:3000/_types/name\nHTTP/1.1 200 OK\nContent-Type: application/json\nContent-Length: 63\nDate: Wed, 08 Apr 2015 23:02:47 GMT\nConnection: keep-alive\n\n{\"title\":\"name of something\",\"id\":\"/type/name\",\"type\":\"string\"}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdweinstein%2Ftypes-endpoint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdweinstein%2Ftypes-endpoint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdweinstein%2Ftypes-endpoint/lists"}