{"id":42186077,"url":"https://github.com/jijeshmohan/janus","last_synced_at":"2026-01-26T22:26:50.340Z","repository":{"id":27867712,"uuid":"31358594","full_name":"jijeshmohan/janus","owner":"jijeshmohan","description":"Janus is a fake rest api server","archived":false,"fork":false,"pushed_at":"2017-03-28T12:12:33.000Z","size":40,"stargazers_count":108,"open_issues_count":3,"forks_count":5,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-08-14T11:59:13.683Z","etag":null,"topics":["go","golang","rest-api","tool","utility"],"latest_commit_sha":null,"homepage":"http://jijeshmohan.github.io/janus","language":"Go","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/jijeshmohan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","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-02-26T08:54:26.000Z","updated_at":"2021-04-14T00:37:00.000Z","dependencies_parsed_at":"2022-08-02T15:30:47.537Z","dependency_job_id":null,"html_url":"https://github.com/jijeshmohan/janus","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/jijeshmohan/janus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jijeshmohan%2Fjanus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jijeshmohan%2Fjanus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jijeshmohan%2Fjanus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jijeshmohan%2Fjanus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jijeshmohan","download_url":"https://codeload.github.com/jijeshmohan/janus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jijeshmohan%2Fjanus/sbom","scorecard":{"id":520201,"data":{"date":"2025-08-11","repo":{"name":"github.com/jijeshmohan/janus","commit":"97d2db02a780d78cd87d1be661ae71a8c5625a07"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.7,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact 1.3.0 not signed: https://api.github.com/repos/jijeshmohan/janus/releases/2092738","Warn: release artifact 1.2.0 not signed: https://api.github.com/repos/jijeshmohan/janus/releases/1442227","Warn: release artifact 1.1.0 not signed: https://api.github.com/repos/jijeshmohan/janus/releases/1100856","Warn: release artifact 1.0.0 not signed: https://api.github.com/repos/jijeshmohan/janus/releases/1067603","Warn: release artifact 1.3.0 does not have provenance: https://api.github.com/repos/jijeshmohan/janus/releases/2092738","Warn: release artifact 1.2.0 does not have provenance: https://api.github.com/repos/jijeshmohan/janus/releases/1442227","Warn: release artifact 1.1.0 does not have provenance: https://api.github.com/repos/jijeshmohan/janus/releases/1100856","Warn: release artifact 1.0.0 does not have provenance: https://api.github.com/repos/jijeshmohan/janus/releases/1067603"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 1 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T02:51:20.698Z","repository_id":27867712,"created_at":"2025-08-20T02:51:20.698Z","updated_at":"2025-08-20T02:51:20.698Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28789734,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T21:49:50.245Z","status":"ssl_error","status_checked_at":"2026-01-26T21:48:29.455Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["go","golang","rest-api","tool","utility"],"created_at":"2026-01-26T22:26:49.266Z","updated_at":"2026-01-26T22:26:50.331Z","avatar_url":"https://github.com/jijeshmohan.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"##Janus\n\nJanus is a fake rest api server which can be used for various purpose including frontend application development , testing etc.\n\n### Features\n\n* Easy to configure and use.\n* Supports all http methods and REST resources.\n* Supports CORS.\n* Basic Auth Support\n* Available in all platforms.\n\n\n### Install\n\n##### Get Binary Distribution\n\nYou can download the latest binary distribution from [here](https://github.com/jijeshmohan/janus/releases/tag/1.1.0)\n\n##### Build from source\n\n[Go](https://golang.org/dl/) should be installed (version **1.4+** is required) in the system. Make sure you have Go properly installed, including setting up your [GOPATH](http://golang.org/doc/code.html#GOPATH).\n\n```go get -u github.com/jijeshmohan/janus```\n\n### How to run\n\nTo run janus, go to any directory and create a json file called ```config.json``` . This defines the REST endpoints which server need to expose. ( config.json file described in the next section.). Run the application in the same directory by typing `janus` in the terminal\n\n\nNote : A sample config and associated files are there in example directory.\n\n\n### Basic Structure of a config.json file\n\nThe basic structure of config file shown below. A config file has follwing attributes\n* port\n* enableLog\n* delay\n* auth\n* jwt\n* resources\n* urls\n* static \n\nDetailed description of each attributes are below.\n\ne.g config.json\n\n```json\n{\n  \"port\": 8080,\n  \"enableLog\": false,\n  \"delay\": 0,\n  \"auth\": {\n    \"username\": \"user1\",\n    \"password\": \"secret\"\n  },\n  \"resources\": [\n    {\n      \"name\": \"user\",\n      \"headers\": {\n        \"key\": \"value\"\n      }\n    }\n  ],\n  \"urls\": [\n    {\n      \"url\": \"direct/url/for/something\",\n      \"method\": \"GET\",\n      \"content_type\": \"application/json\",\n      \"status\": 200,\n      \"file\": \"./files/some.json\",\n      \"headers\": {\n        \"key\": \"value\",\n        \"key1\": \"value1\"\n      }\n    }\n  ]\n}\n```\n\n##### Port\n\n**port** in configuration file defines in which port the server needs to run.This is an optional field and if not provided the default port is 8000.\n\n\n\n##### EnableLog\n\n**enableLog** in configuration file defines whether we need to log the requests form clients. Default values is false.\n\n\n##### Delay\n\n**delay** in configuration file provides a response delay ( in milliseconds). Default value is 0 which means there is no delay. This feature helps to simulate network delay or server response time.\n\n##### Auth\n\n**auth** in configuration provides basic auth support in janus. This is an optional field. If provided this will verify the username and password for all requests.\n\nYou need to specify username and password like below\n\n```js\n\"auth\": {\n  \"username\": \"user1\",\n  \"password\": \"password\"\n}\n```\n\n##### JWT\n\n**jwt** in configuration provides jwt support in janus. This will issue a new jwt token when they call the url specified in jwt section below.\n\n\n```js\n\"jwt\": {\n  \"url\": \"/auth/token\",\n  \"exp:\" 12, // expiry in minutes \n  \"secret\": \"secret key\"\n  \"data\": {\n    \"userid\": 1234,\n    \"admin\": false\n  }\n}\n```\n\n##### Static \n\n**staic** in configuration allows to serve static files in janus. With this option you can make janus to serve static files for your api ( e.g. javascript frontend like angular, reactjs etc..)\n\n```js\n\"static\": {\n\t\"url\": \"/ui\",\n\t\"path\": \"public\"\n}\n```\nIn above configuration, url specifies what would be the root path of your static files , like `http://localhost:8080/ui/index.html` and `path` specified the actual directory from which teh static files need to be served. This is relative to the configuration files directory. \n\n\n##### REST enspoints\n\nYou can define two types of REST endpoints in the configuration file\n\n* resources\n* urls\n\n##### Resources\n\n\nThis represent basic REST resource which will exposes all [standard methods](http://restful-api-design.readthedocs.org/en/latest/methods.html#standard-methods). Janus will look for a folder with the name of the resource in the same directory as routes.json for sending the data correspoding to the methods.\n\ne.g:\n\n```js\n{\n\t\"name\": \"user\"\n\t\"headers\": {  // headers field is optional\n\t\t\"key\": \"value\"\n\t}\n}\n```\n\ne.g for user resource , it wil look follwoing files to send the data\n\n| Verb | Url | FILE | Description |\n|--------|--------|---|---|\n| GET       | /user       |  ./user/index.json  | if the file not available app will send a 404|\n| POST       | /user       |  ./user/post.json  | if file is present it will send 201 with the content of the file otherwise 404|\n|GET| /user/:item |./user/[any file name which is matching :item].json | if the file present, it will send the file with 200, otherwise 404. you can add item1.json, item2.json etc if you want to fake different get request\n| PUT | /user/:item |  will use the same file specified above | if file is present it will send 200 with the content of the file otherwise 404. You can specify any number of files to match the get requst like  user1.json, admin.json etc.\n| PATCH | /user/:item | will use the same file specified above | if file is present it will send 200 with the content of the file otherwise 404.\n| DELETE | /user/:item | will use the same file specified above | if file is present it will send 200 with the content of the file otherwise 405. If you have specified item1.json, then it will send 200 for that particular item's request.\n\nYou can specify any header informations which need to send along with the methods. This is optional field\n\n##### Urls\nUrls section is for specifying individual urls which can't qualify for a standard REST resource methods.\n\nThis section gives more freedom in terms for defining HTTP Methods and content type and files.\n\nA single url representasion showed below\n\n```js\n {\n   \"url\": \"/admin/user/enable\", //mandatory\n   \"method\": \"GET\", // mandatory\n   \"content_type\": \"application/json\", // optional. default to application/json; charset=utf-8\n   \"status\": 200, // optional , default to 200\n   \"file\": \"./files/some.json\" // optional, if not specified , the response will be empty string. if specified it should be a valid file.\n   \"headers\": {  //Optional\n    \"key\": \"value\",\n    \"key1\": \"value1\"\n   }\n}\n```\n\nNote: Url also support dynamic url like ```/admin/{user}/enable``` which can match to any  user name like ```/admin/user1/enable``` or ```/admin/anotheruser/enable``` .\n\n### TODO\n\n* File upload support\n* Compression\n* Websocket support.\n* Admin UI for configuration and adding url at runtime.\n\n### Changelog\n\nPlease check the changelog [here](https://github.com/jijeshmohan/janus/blob/master/CHANGELOG)\n\n### License\n\nThe MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjijeshmohan%2Fjanus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjijeshmohan%2Fjanus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjijeshmohan%2Fjanus/lists"}