{"id":22338030,"url":"https://github.com/sunkuo/joi-router","last_synced_at":"2025-07-31T23:33:35.214Z","repository":{"id":57281419,"uuid":"90275645","full_name":"sunkuo/joi-router","owner":"sunkuo","description":":basketball: Input \u0026 Output validated routing for Express","archived":false,"fork":false,"pushed_at":"2017-05-11T14:50:15.000Z","size":45,"stargazers_count":18,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-25T12:02:08.534Z","etag":null,"topics":["express","joi","joi-validation"],"latest_commit_sha":null,"homepage":"","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/sunkuo.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":"2017-05-04T14:53:45.000Z","updated_at":"2020-11-04T08:14:58.000Z","dependencies_parsed_at":"2022-09-18T06:04:59.471Z","dependency_job_id":null,"html_url":"https://github.com/sunkuo/joi-router","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/sunkuo%2Fjoi-router","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunkuo%2Fjoi-router/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunkuo%2Fjoi-router/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunkuo%2Fjoi-router/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sunkuo","download_url":"https://codeload.github.com/sunkuo/joi-router/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228054438,"owners_count":17862129,"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":["express","joi","joi-validation"],"created_at":"2024-12-04T06:12:50.709Z","updated_at":"2024-12-04T06:12:51.483Z","avatar_url":"https://github.com/sunkuo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# joi-router\n:basketball: Input \u0026amp; Output validated routing for Express\n\n[![npm version](https://badge.fury.io/js/joi-router.svg)](https://badge.fury.io/js/joi-router) [![Build Status](https://travis-ci.org/sunkuo/joi-router.svg?branch=master)](https://travis-ci.org/sunkuo/joi-router) [![Coverage Status](https://coveralls.io/repos/github/sunkuo/joi-router/badge.svg?branch=master)](https://coveralls.io/github/sunkuo/joi-router?branch=master) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n## Todo List\n- :white_check_mark: Input Validated Routing\n- :white_check_mark: Output Validated Routing\n- :white_check_mark: Examples to show how to use joi-router\n- :white_check_mark: Self-contained Test\n- :white_check_mark: Continuous integration\n- :white_check_mark: Code coverage\n- :ballot_box_with_check: Joi-router to api documents\n\n## How to install\n\n`yarn add joi-router`\n\n## Get Started\n\n### Input Validaiton\n```\nconst express = require('express')\nconst Joi = require('joi')\nrequire('joi-router')\nconst app = express()\n\napp.get('/foo', {query: {\n  userId: Joi.string().alphanum().min(3).max(30).required()\n}}, function (req, res, next) {\n  res.json({\n    result: 'success'\n  })\n})\n```\n\n#### Output Validation\n```\napp.get('/foo', {\n  output: {\n    '200': { content: Joi.string().alphanum().min(3).max(30).required() }\n  }\n}, function (req, res, next) {\n  res.json({\n    content: 'Lorem'\n  })\n})\n\napp.listen(3000, () =\u003e {\n  console.log('Server Run!')\n})\n```\n\n## Node compatibility\n\nNodeJS `\u003e= 6.0` is required.\n\n## Performance\n\nJoi-router only run once to add validation middleware when express start, so it does not make express slow.\n\n## LICENSE\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunkuo%2Fjoi-router","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsunkuo%2Fjoi-router","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunkuo%2Fjoi-router/lists"}