├── .eslintignore ├── .eslintrc ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request_template.md └── pull_request_template.md ├── .gitignore ├── .prettierignore ├── .prettierrc ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── _test_ ├── contact.test.js ├── home.test.js ├── photos.test.js ├── products.test.js ├── tasks.test.js └── users.test.js ├── data ├── bookdata.json ├── commentdata.json ├── moviedata.json ├── photodata.json ├── photofooddata.json ├── productdata.json ├── showsdata.json ├── songdata.json ├── taskdata.json └── userdata.json ├── gulpfile.js ├── logo.jpg ├── package-lock.json ├── package.json ├── src ├── api │ └── routes │ │ ├── books.ts │ │ ├── comments.ts │ │ ├── foodphotos.ts │ │ ├── home.ts │ │ ├── photos.ts │ │ ├── products.ts │ │ ├── shows.ts │ │ ├── songs.ts │ │ ├── tasks.ts │ │ ├── users.ts │ │ └── vehicles.ts ├── app.ts ├── public │ ├── fonts │ │ └── terminal-font.woff │ ├── images │ │ └── favicon.ico │ ├── scripts │ │ └── script.js │ └── stylesheets │ │ └── master.css ├── server.ts └── views │ ├── data.ts │ └── index.ejs └── tsconfig.json /.eslintignore: -------------------------------------------------------------------------------- 1 | **/node_modules 2 | **/dist 3 | **/package.json 4 | **/package-lock.json 5 | **/tsconfig.json -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["prettier"], 3 | "plugins": ["prettier"], 4 | "env": { 5 | "browser": true, 6 | "webextensions": true 7 | }, 8 | "rules": { 9 | "prettier/prettier": "error" 10 | }, 11 | "parser": "@typescript-eslint/parser", 12 | "parserOptions": { 13 | "ecmaVersion": 6 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: "" 5 | labels: bug 6 | assignees: "" 7 | --- 8 | 9 | **Describe the bug -** 10 | A clear and concise description of what the bug is. 11 | 12 | **Steps To Reproduce the behaviour -** 13 | Steps in points to reproduce the bug 14 | 15 | **Expected behaviour -** 16 | A clear and concise description of what you expected to happen. 17 | 18 | **Logs** 19 | If needed, share logs related to your problem. 20 | 21 | **Screenshots or screen recordings -** 22 | If applicable, add screenshots/screen recordings to help explain your problem. 23 | 24 | **System Information (please complete the following information):** 25 | 26 | - OS: [e.g. iOS] 27 | - Browser [e.g. chrome, safari] 28 | - Version [e.g. 22] 29 | - Device 30 | 31 | **Additional context -** 32 | Add any other context about the problem here. 33 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request_template.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "New Features" 3 | about: Suggest your idea to add new features 4 | title: "" 5 | labels: "" 6 | assignees: "" 7 | --- 8 | 9 | **Describe the feature** 10 | A clear and concise description of what you want to add. 11 | 12 | **Is your feature request related to a problem? Please describe.** :bulb: 13 | A clear and concise description of what the problem is. 14 | 15 | **Describe the solution you'd like** :zap: 16 | A clear and concise description of what you want to happen. 17 | 18 | **Expected behavior** 19 | A clear and concise description of what you expect to happen. 20 | 21 | **Screenshots** 22 | If applicable, add screenshots to help explain your idea. 23 | 24 | **Device Information [optional]:** 25 | 26 | - OS: [e.g. iOS/Android] 27 | 28 | **Additional context** 29 | Add any other context about the problem here. 30 | 31 | **Are you working on this feature? (Yes/No)** 32 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | # Related Issue 2 | 3 | - closes #issue goes here 4 | 5 | # Proposed Changes 6 | 7 | - change 1 8 | - change 2 9 | 10 | # Additional Info 11 | 12 | - any additional information or context 13 | 14 | # Checklist 15 | 16 | - [ ] Tests 17 | - [ ] Translations 18 | - [ ] Documentation 19 | 20 | # Screenshots 21 | 22 | | Original | Updated | 23 | | :-----------------------: | :----------------------: | 24 | | ** original screenshot ** | ** updated screenshot ** | 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.test 74 | 75 | # parcel-bundler cache (https://parceljs.org/) 76 | .cache 77 | 78 | # Next.js build output 79 | .next 80 | 81 | # Nuxt.js build / generate output 82 | .nuxt 83 | dist 84 | 85 | # Gatsby files 86 | .cache/ 87 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 88 | # https://nextjs.org/blog/next-9-1#public-directory-support 89 | # public 90 | 91 | # vuepress build output 92 | .vuepress/dist 93 | 94 | # Serverless directories 95 | .serverless/ 96 | 97 | # FuseBox cache 98 | .fusebox/ 99 | 100 | # DynamoDB Local files 101 | .dynamodb/ 102 | 103 | # TernJS port file 104 | .tern-port 105 | 106 | # VSCode local files 107 | .vscode/ 108 | 109 | src/api/routes/usertest.ts -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | **/node_modules 2 | **/dist 3 | **/package.json 4 | **/package-lock.json 5 | **/.eslintrc 6 | **/tsconfig.json -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "trailingComma": "es5", 3 | "tabWidth": 4, 4 | "semi": false, 5 | "singleQuote": true, 6 | "printWidth": 120 7 | } -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in our 6 | community a harassment-free experience for everyone, regardless of age, body 7 | size, visible or invisible disability, ethnicity, sex characteristics, gender 8 | identity and expression, level of experience, education, socio-economic status, 9 | nationality, personal appearance, race, religion, or sexual identity 10 | and orientation. 11 | 12 | We pledge to act and interact in ways that contribute to an open, welcoming, 13 | diverse, inclusive, and healthy community. 14 | 15 | ## Our Standards 16 | 17 | Examples of behavior that contributes to a positive environment for our 18 | community include: 19 | 20 | - Demonstrating empathy and kindness toward other people 21 | - Being respectful of differing opinions, viewpoints, and experiences 22 | - Giving and gracefully accepting constructive feedback 23 | - Accepting responsibility and apologizing to those affected by our mistakes, 24 | and learning from the experience 25 | - Focusing on what is best not just for us as individuals, but for the 26 | overall community 27 | 28 | Examples of unacceptable behavior include: 29 | 30 | - The use of sexualized language or imagery, and sexual attention or 31 | advances of any kind 32 | - Trolling, insulting or derogatory comments, and personal or political attacks 33 | - Public or private harassment 34 | - Publishing others' private information, such as a physical or email 35 | address, without their explicit permission 36 | - Other conduct which could reasonably be considered inappropriate in a 37 | professional setting 38 | 39 | ## Enforcement Responsibilities 40 | 41 | Community leaders are responsible for clarifying and enforcing our standards of 42 | acceptable behavior and will take appropriate and fair corrective action in 43 | response to any behavior that they deem inappropriate, threatening, offensive, 44 | or harmful. 45 | 46 | Community leaders have the right and responsibility to remove, edit, or reject 47 | comments, commits, code, wiki edits, issues, and other contributions that are 48 | not aligned to this Code of Conduct, and will communicate reasons for moderation 49 | decisions when appropriate. 50 | 51 | ## Scope 52 | 53 | This Code of Conduct applies within all community spaces, and also applies when 54 | an individual is officially representing the community in public spaces. 55 | Examples of representing our community include using an official e-mail address, 56 | posting via an official social media account, or acting as an appointed 57 | representative at an online or offline event. 58 | 59 | ## Enforcement 60 | 61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 | reported to the community leaders responsible for enforcement at 63 | help@sanscript.tech 64 | All complaints will be reviewed and investigated promptly and fairly. 65 | 66 | All community leaders are obligated to respect the privacy and security of the 67 | reporter of any incident. 68 | 69 | ## Enforcement Guidelines 70 | 71 | Community leaders will follow these Community Impact Guidelines in determining 72 | the consequences for any action they deem in violation of this Code of Conduct: 73 | 74 | 1. ### Correction 75 | 76 | **Community Impact**: Use of inappropriate language or other behavior deemed 77 | unprofessional or unwelcome in the community. 78 | 79 | **Consequence**: A private, written warning from community leaders, providing 80 | clarity around the nature of the violation and an explanation of why the 81 | behavior was inappropriate. A public apology may be requested. 82 | 83 | 2. ### Warning 84 | 85 | **Community Impact**: A violation through a single incident or series 86 | of actions. 87 | 88 | **Consequence**: A warning with consequences for continued behavior. No 89 | interaction with the people involved, including unsolicited interaction with 90 | those enforcing the Code of Conduct, for a specified period of time. This 91 | includes avoiding interactions in community spaces as well as external channels 92 | like social media. Violating these terms may lead to a temporary or 93 | permanent ban. 94 | 95 | 3. ### Temporary Ban 96 | 97 | **Community Impact**: A serious violation of community standards, including 98 | sustained inappropriate behavior. 99 | 100 | **Consequence**: A temporary ban from any sort of interaction or public 101 | communication with the community for a specified period of time. No public or 102 | private interaction with the people involved, including unsolicited interaction 103 | with those enforcing the Code of Conduct, is allowed during this period. 104 | Violating these terms may lead to a permanent ban. 105 | 106 | 4. ### Permanent Ban 107 | 108 | **Community Impact**: Demonstrating a pattern of violation of community 109 | standards, including sustained inappropriate behavior, harassment of an 110 | individual, or aggression toward or disparagement of classes of individuals. 111 | 112 | **Consequence**: A permanent ban from any sort of public interaction within 113 | the community. 114 | 115 | ## Attribution 116 | 117 | This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/version/2/0/code_of_conduct.html) version 2.0. 118 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contribuiton Guidelines 2 | 3 | - Please **specify your full name** on your GitHub profile for review. 4 | - Each participant will be assigned **2 issues (max)** at a time to work. 5 | - Participants have **7 days** to complete issues. 6 | - Participants have to **comment on issues** they would like to work on, and mentors will assign you. 7 | - Issues will be assigned on a **first-come, first-serve basis.** 8 | - Participants can also open their issues, but it needs to be verified and labelled by a mentor. 9 | - Before opening a new issue, please check if it is already created or not. 10 | - Share your **work sample** and discuss it before sending PR. 11 | - Pull requests will be merged after being reviewed by a mentor/maintainer. 12 | - Create a pull request from **a branch** not from **Main**. 13 | - You will be **scored** based on the level of issues you have solved. 14 | - It might take a day or tow to review your pull request. Please have patience and be nice. 15 | - We all are here to learn. You are allowed to make mistakes. That's how you learn, right! 16 | 17 | **Pull Requests review criteria:** 18 | 19 | - Please mention parent issue no. with "**#**" in the description while sending a pull request. 20 | - Your work must be original, written by you not copied from other resources. 21 | - You must **comment** on your code where necessary. 22 | 23 | ## GIT AND GITHUB 24 | 25 | --- 26 | 27 | Before continuing we want to clarify the difference between Git and Github. Git is a version control system(VCS) which is a tool to manage the history of our Source Code. GitHub is a hosting service for Git projects. 28 | 29 | We assume you have created an account on Github and installed Git on your System. 30 | 31 | Now tell Git your name and E-mail (used on Github) address. 32 | 33 | `$ git config --global user.name "YOUR NAME"` 34 | `$ git config --global user.email "YOUR EMAIL ADDRESS"` 35 | This is an important step to mark your commits to your name and email. 36 | 37 | ### FORK A PROJECT - 38 | 39 | --- 40 | 41 | You can use github explore - https://github.com/explore to find a project that interests you and match your skills. Once you find your cool project to workon, you can make a copy of project to your account. This process is called forking a project to your Github account. On Upper right side of project page on Github, you can see - 42 | 43 |

44 | 45 | Click on fork to create a copy of project to your account. This creates a separate copy for you to workon. 46 | 47 | ### FINDING A FEATURE OR BUG TO WORKON - 48 | 49 | --- 50 | 51 | Open Source projects always have something to workon and improves with each new release. You can see the issues section to find something you can solve or report a bug. The project managers always welcome new contributors and can guide you to solve the problem. You can find issues in the right section of project page. 52 | 53 |

54 | 55 | ### CLONE THE FORKED PROJECT - 56 | 57 | --- 58 | 59 | You have forked the project you want to contribute to your github account. To get this project on your development machine we use clone command of git. 60 | 61 | `$ git clone https://github.com//.git` 62 | Now you have the project on your local machine. 63 | 64 | ### ADD A REMOTE (UPSTREAM) TO ORIGINAL PROJECT REPOSITORY 65 | 66 | --- 67 | 68 | Remote means the remote location of project on Github. By cloning, we have a remote called origin which points to your forked repository. Now we will add a remote to the original repository from where we had forked. 69 | 70 | `$ cd ` 71 | `$ git remote add upstream https://github.com//.git` 72 | You will see the benefits of adding remote later. 73 | 74 | ### SYNCHRONIZING YOUR FORK - 75 | 76 | --- 77 | 78 | Open Source projects have a number of contributors who can push code anytime. So it is necessary to make your forked copy equal with the original repository. The remote added above called Upstream helps in this. 79 | 80 | `$ git checkout master` 81 | `$ git fetch upstream` 82 | `$ git merge upstream/master` 83 | `$ git push origin master` 84 | The last command pushes the latest code to your forked repository on Github. The origin is the remote pointing to your forked repository on github. 85 | 86 | ### CREATE A NEW BRANCH FOR A FEATURE OR BUGFIX - 87 | 88 | --- 89 | 90 | Normally, all repositories have a master branch which is considered to remain stable and all new features should be made in a separate branch and after completion merged into master branch. So we should create a new branch for our feature or bugfix and start working on the issue. 91 | 92 | `$ git checkout -b ` 93 | This will create a new branch out of master branch. Now start working on the problem and commit your changes. 94 | 95 | `$ git add --all` 96 | `$ git commit -m ""` 97 | The first command adds all the files or you can add specific files by removing -a and adding the file names. The second command gives a message to your changes so you can know in future what changes this commit makes. If you are solving an issue on original repository, you should add the issue number like #35 to your commit message. This will show the reference to commits in the issue. 98 | 99 | ### REBASE YOUR FEATURE BRANCH WITH UPSTREAM- 100 | 101 | --- 102 | 103 | It can happen that your feature takes time to complete and other contributors are constantly pushing code. After completing the feature your feature branch should be rebase on latest changes to upstream master branch. 104 | 105 | `$ git checkout ` 106 | `$ git pull --rebase upstream master` 107 | Now you get the latest commits from other contributors and check that your commits are compatible with the new commits. If there are any conflicts solve them. 108 | 109 | ### SQUASHING YOUR COMMITS- 110 | 111 | --- 112 | 113 | You have completed the feature, but you have made a number of commits which make less sense. You should squash your commits to make good commits. 114 | 115 | `$ git rebase -i HEAD~5` 116 | This will open an editor which will allow you to squash the commits. 117 | 118 | ### PUSH CODE AND CREATE A PULL REQUEST - 119 | 120 | --- 121 | 122 | Till this point you have a new branch with the feature or bugfix you want in the project you had forked. Now push your new branch to your remote fork on github. 123 | 124 | `$ git push origin ` 125 | Now you are ready to help the project by opening a pull request means you now tell the project managers to add the feature or bugfix to original repository. You can open a pull request by clicking on green icon - 126 | 127 |

128 | 129 | Remember your upstream base branch should be master and source should be your feature branch. Click on create pull request and add a name to your pull request. You can also describe your feature. 130 | 131 | Awesome! You have made your first contribution. If you have any doubts please let me know in the comments. 132 | 133 | #### BE OPEN! 134 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 | [![GitHub contributors](https://img.shields.io/github/contributors/adityabisoi/json-hub)](https://github.com/adityabisoi/json-hub/graphs/contributors/) 4 | [![Issues](https://img.shields.io/github/issues/adityabisoi/json-hub)](https://github.com/adityabisoi/json-hub/issues) 5 | [![PRs](https://img.shields.io/github/issues-pr/adityabisoi/json-hub)](https://github.com/adityabisoi/json-hub/pulls) 6 | [![Forks](https://img.shields.io/github/forks/adityabisoi/json-hub)](https://github.com/adityabisoi/json-hub) 7 | [![Stars](https://img.shields.io/github/stars/adityabisoi/json-hub)](https://github.com/adityabisoi/json-hub) 8 | [![Join the chat at https://gitter.im/fetch-lobby/community](https://badges.gitter.im/fetch-lobby/community.svg)](https://gitter.im/fetch-lobby/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 9 | 10 |

11 |

12 | 13 |

14 |

15 | A community-owned REST API service for testers and developers. JSON Hub provides REST API endpoints for different types of placeholders, which can be easily used during testing and development without the need for creating sample data manually. 16 |

17 | 18 | ### Click [here](https://json-hub.herokuapp.com/) to use json-hub! 19 | 20 | ## Table of Contents 21 | 22 | - [Technology Stack](#technology-stack) 23 | - [Installation](#installation) 24 | - [Code linting and formatting](#code-linting-and-formatting) 25 | - [Testing](#testing) 26 | - [Documentation](#documentation) 27 | - [Help & support](#help--support) 28 | - [Contribution](#contribution) 29 | - [Contributors](#contributors) 30 | - [License](#license) 31 | - [Open Source Events](#open-source-events) 32 | 33 | ## Technology Stack 34 |
    35 |
  • NodeJS
  • 36 |
  • Express
  • 37 |
  • Typescript
  • 38 |
  • CI/CD
  • 39 |
40 | 41 | ## Installation 42 | - Fork and clone the project 43 | - `cd json-hub/` and run `npm install` to install dependencies 44 | - Run `npm run dev` to run the project in development 45 | 46 | ## Code linting and formatting 47 | Json-hub uses Prettier + Eslint for code listing and formatting. To check if your code follows the guidelines, run `npm run lint` 48 | 49 | **Note :** The project uses **Husky**, a pre-commit GIT hook which checks if the code follows linting guidelines before commiting. This helps prevent unwanted linting errors in the pipelines. 50 | 51 | ## Testing 52 | - To test the endpoints provided by the application, tools such as [postman](https://www.postman.com/) can be used 53 | 54 | ## Documentation 55 | To understand the aim, scope and technologies used in the project, please see the [documentation](https://bit.ly/36PmwEc) 56 | 57 | ## Help & support 58 | If you are stuck somewhere or do not understand what to do, feel free to reach out to mentors/ admin in the [Gitter community channel](https://gitter.im/fetch-lobby/community). 59 | 60 | ## Contribution 61 | Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. 62 |
63 | Please refer the contribution guideline before making any contribution. 64 | 65 | ## Contributors 66 | 67 | 68 | 73 | 74 |
69 | 70 | 71 | 72 |
75 | 76 | ## License 77 | This project is licensed under the GPL V3 License - see the [LICENSE.md](LICENSE.md) file for details 78 | 79 | ## Open Source Events 80 | DS-ALGO-SOLUTIONS 81 | -------------------------------------------------------------------------------- /_test_/contact.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom' 3 | import Contact from '../Contact' 4 | 5 | import { render } from '@testing-library/react' 6 | import '@testing-library/jest-dom/extend-expect' 7 | 8 | it('renders correctly without crashing', () => { 9 | const div = document.createElement('div') 10 | ReactDOM.render(, div) 11 | }) 12 | 13 | it('checks content', () => { 14 | const { getByTestId } = render() 15 | expect(getByTestId('contact-div')).toHaveTextContent('GOT QUESTIONS?') 16 | }) 17 | -------------------------------------------------------------------------------- /_test_/home.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom' 3 | import Home from '../Home' 4 | 5 | import { render } from '@testing-library/react' 6 | import '@testing-library/jest-dom/extend-expect' 7 | 8 | it('renders correctly without crashing', () => { 9 | const div = document.createElement('div') 10 | ReactDOM.render(, div) 11 | }) 12 | 13 | it('checks content of homepage', () => { 14 | const { getByTestId } = render() 15 | expect(getByTestId('home-div')).toHaveTextContent('JSON Hub') 16 | }) 17 | -------------------------------------------------------------------------------- /_test_/photos.test.js: -------------------------------------------------------------------------------- 1 | const supertest = require('supertest') 2 | const endpoint = 'http://localhost:5000/photos' 3 | 4 | describe('Testing the photos endpoint', () => { 5 | it('Photos route returns true for status', async () => { 6 | const response = await supertest(endpoint).get('/') 7 | expect(response.status).toBe(200) 8 | }) 9 | 10 | it('Tests the photos route with an individual ID', async () => { 11 | const response = await supertest(endpoint).get('/5/') 12 | expect(response.status).toBe(200) 13 | expect(response.body.data.name).toBe('yellow son robot') 14 | expect(response.body.data.picture).toBe('https://robohash.org/6') 15 | }) 16 | }) 17 | -------------------------------------------------------------------------------- /_test_/products.test.js: -------------------------------------------------------------------------------- 1 | const supertest = require('supertest') 2 | const endpoint = 'http://localhost:5000/products' 3 | 4 | describe('Testing the products endpoint', () => { 5 | it('Products route returns true for status', async () => { 6 | const response = await supertest(endpoint).get('/') 7 | expect(response.status).toBe(200) 8 | }) 9 | 10 | it('Tests the products route with an individual ID', async () => { 11 | const response = await supertest(endpoint).get('/5/') 12 | expect(response.status).toBe(200) 13 | expect(response.body.data.name).toBe('digital camera') 14 | expect(response.body.data.price).toBe('5999') 15 | }) 16 | }) 17 | -------------------------------------------------------------------------------- /_test_/tasks.test.js: -------------------------------------------------------------------------------- 1 | const supertest = require('supertest') 2 | const endpoint = 'http://localhost:5000/tasks' 3 | 4 | describe('Testing the tasks endpoint', () => { 5 | it('Tasks route returns true for status', async () => { 6 | const response = await supertest(endpoint).get('/') 7 | expect(response.status).toBe(200) 8 | }) 9 | 10 | it('Tests the tasks route with an individual ID', async () => { 11 | const response = await supertest(endpoint).get('/1/') 12 | expect(response.status).toBe(200) 13 | expect(response.body.data.task_name).toBe('drinking') 14 | expect(response.body.data.details).toBe('drink delicious chai or coffee') 15 | }) 16 | }) 17 | -------------------------------------------------------------------------------- /_test_/users.test.js: -------------------------------------------------------------------------------- 1 | const supertest = require('supertest') 2 | const endpoint = 'http://localhost:3000/users' 3 | 4 | describe('Testing the users API', () => { 5 | it('Tests the users route and returns true for status', async () => { 6 | const response = await supertest(endpoint).get('/') 7 | expect(response.status).toBe(200) 8 | }) 9 | }) 10 | -------------------------------------------------------------------------------- /data/bookdata.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "title": "The Story Of My Experiments With The Truth", 5 | "author": "Mohandas Karamchand Gandhi", 6 | "rating": "4.5", 7 | "descritpion": "Mohandas Karamchand Gandhi has always been a very prominent figure in Indian history. From his unbeatable spirit to inspiring courage, from various controversies to his life as the father of the nation, Gandhi has always been an interesting, inspiring and impressive personality to read about.", 8 | "price": "₹159" 9 | }, 10 | { 11 | "title": "The Guide", 12 | "author": "R.K. Narayan", 13 | "rating": "4.5", 14 | "descritpion": "R.K Narayan is best known for stories based in and around the fictional village of Malgudi. The Guide is yet another story set up in Malgudi. R.K. Narayan won the Sahitya Akademi Award for the book in 1960. The Guide is the story of a tour guide who transforms himself into a spiritual Guru and then the greatest holy man of India. The book was also adapted as a film which starred the legendary actor Dev Anand.", 15 | "price": "₹156" 16 | }, 17 | { 18 | "title": "A Fine Balance", 19 | "author": "Rohinton Mistry", 20 | "rating": "4.4", 21 | "descritpion": "A fine balance revolves around various characters in Mumbai (then Bombay) during the time of turmoil and government emergencies. The story of friendship and love that progresses among the characters of the book will keep you hooked till the end.", 22 | "price": "₹1,075" 23 | }, 24 | { 25 | "title": "Midnight’s Children", 26 | "author": "Salman Rushdie", 27 | "rating": "4.3", 28 | "descritpion": "Midnight’s Children portrays the journey of India from British rule to independence and then partition. The book received a great response, winning the Booker Prize in 1981 and the “Booker of Bookers” Prize (commemorating the best among all the Booker winners) twice – in 1993 and 2008! The book travels to various parts of the country including Kashmir, Agra and Mumbai and incorporates many actual historic events.", 29 | "price": "₹300" 30 | }, 31 | { 32 | "title": "The Interpreter Of Maladies", 33 | "author": "Jhumpa Lahiri", 34 | "rating": "4.5", 35 | "descritpion": "This is a collection of nine stories by Lahiri. The stories are based on lives of Indians and Indian Americans who are lost between the two cultures. The book was published in 1999 and won the Pulitzer Prize for Fiction and the Hemingway Foundation/PEN Award in the year 2000 and has sold over 15 million copies worldwide.", 36 | "price": "₹268" 37 | }, 38 | { 39 | "title": "A Suitable Boy", 40 | "author": "Vikram Seth", 41 | "rating": "4.0", 42 | "descritpion": "Published in 1993, this 1349-pages-long-book is one of the longest novels ever published in a single volume in the English Language. The story focuses on India post-partition as a family looks for a suitable boy to marry their daughter.", 43 | "price": "₹947" 44 | }, 45 | { 46 | "title": "God of Small Things", 47 | "author": "Arundhati Roy", 48 | "rating": "4.1", 49 | "descritpion": "The debut novel by Roy, which took almost four years to finish is a story of fraternal twins and how small things make a large difference in people’s lives and behavior. The book was awarded the Booker Prize in 1997 and is Roy’s only published novel so far. The story narrated in third person is set in Kerala, and takes place in 1969.", 50 | "price": "₹275" 51 | }, 52 | { 53 | "title": "The Glass Palace", 54 | "author": "Amitav Ghosh", 55 | "rating": "4.5", 56 | "descritpion": "This book won Grand Prize for Fiction at the Frankfurt International e-Book Awards in 2001. The story is set in Burma and focuses on various issues during the British invasion in 1885. The novel beautifully portrays the circumstances and incidents that made Burma, India and Malaya what they are today. This story of the empire, love and the changing society is definitely worth reading.", 57 | "price": "₹248" 58 | }, 59 | { 60 | "title": "The Inheritance of Loss", 61 | "author": "Kiran Desai", 62 | "rating": "4.3", 63 | "descritpion": "The book, written over a period of seven years after her first book, portrays different conflicts between various Indian groups, in the past and at present. It shows how people find the English lifestyle fascinating and also captures the perception of various opportunities in the US. The book won Desai various awards including the Man Booker Prize in 2006 and the National Book Critics Circle Fiction Award.", 64 | "price": "₹319" 65 | }, 66 | { 67 | "title": "The Private Life of an Indian Prince", 68 | "author": "Mulk Raj Anand", 69 | "rating": "3.5", 70 | "descritpion": "This book was published in 1953 and is considered as one of the Anand’s finest works. The story revolves around abolition of princely states in India, focusing on the life of a King and his fascination towards one of his mistresses. The story has some real life incidents which are beautifully converted into fiction.", 71 | "price": "₹599" 72 | } 73 | ] 74 | } 75 | -------------------------------------------------------------------------------- /data/commentdata.json: -------------------------------------------------------------------------------- 1 | { 2 | "comments": 3 | [{ 4 | "profile":"https://images.unsplash.com/photo-1552207802-77bcb0d13122?ixid=MXwxMjA3fDB8MHxzZWFyY2h8MXx8c2hpcHxlbnwwfHwwfA%3D%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60", 5 | "name":"USER1", 6 | "data":" Lorem Ipsum" 7 | }, 8 | { 9 | "profile":"https://images.unsplash.com/photo-1523536777042-c391e30190ef?ixid=MXwxMjA3fDB8MHx0b3BpYy1mZWVkfDZ8SnBnNktpZGwtSGt8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60", 10 | "name":"USER2", 11 | "data":"dolor sit amet" 12 | },{ 13 | "profile":"https://images.unsplash.com/photo-1589676383923-3c4e9ec0b94d?ixid=MXwxMjA3fDB8MHx0b3BpYy1mZWVkfDE1fEpwZzZLaWRsLUhrfHxlbnwwfHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60", 14 | "name":"USER3", 15 | "data":"consectetur adipiscing elit" 16 | },{ 17 | "profile":"https://images.unsplash.com/photo-1540126034813-121bf29033d2?ixid=MXwxMjA3fDB8MHxzZWFyY2h8NHx8cGFuZGF8ZW58MHx8MHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60", 18 | "name":"USER4", 19 | "data":"sed do eiusmod tempor" 20 | },{ 21 | "profile":"https://images.unsplash.com/photo-1604336755604-96ee6fa9f3f1?ixid=MXwxMjA3fDB8MHxzZWFyY2h8M3x8Z2lyYWZmZXxlbnwwfHwwfA%3D%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60", 22 | "name":"USER5", 23 | "data":"incididunt ut labore et dolore" 24 | },{ 25 | "profile":"https://images.unsplash.com/photo-1516255648388-71880c3cf449?ixid=MXwxMjA3fDB8MHxzZWFyY2h8MXx8bGVhcGFyZHxlbnwwfHwwfA%3D%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60", 26 | "name":"USER6", 27 | "data":"Ut enim ad minim veniam," 28 | },{ 29 | "profile":"https://images.unsplash.com/photo-1575550959106-5a7defe28b56?ixid=MXwxMjA3fDB8MHxzZWFyY2h8MXx8d2lsZGxpZmV8ZW58MHx8MHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60", 30 | "name":"USER7", 31 | "data":" ullamco laboris nisi ut" 32 | },{ 33 | "profile":"https://images.unsplash.com/photo-1549480017-d76466a4b7e8?ixid=MXwxMjA3fDB8MHxzZWFyY2h8NHx8d2lsZGxpZmV8ZW58MHx8MHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60", 34 | "name":"USER8", 35 | "data":"aliquip ex ea commodo consequat" 36 | },{ 37 | "profile":"https://images.unsplash.com/photo-1552519507-da3b142c6e3d?ixid=MXwxMjA3fDB8MHxzZWFyY2h8Mnx8Y2Fyc3xlbnwwfHwwfA%3D%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60", 38 | "name":"USER9", 39 | "data":"Duis aute irure dolor in" 40 | },{ 41 | "profile":"https://images.unsplash.com/photo-1614607883319-bcb21f643356?ixid=MXwxMjA3fDB8MHx0b3BpYy1mZWVkfDR8cm5TS0RId3dZVWt8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60", 42 | "name":"USER10", 43 | "data":"reprehenderit in voluptate" 44 | },{ 45 | "profile":"https://images.unsplash.com/photo-1548656132-d59f9079c044?ixid=MXwxMjA3fDB8MHx0b3BpYy1mZWVkfDEzfHJuU0tESHd3WVVrfHxlbnwwfHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60", 46 | "name":"USER11", 47 | "data":"Excepteur sint occaecat cupidatat " 48 | } 49 | ] 50 | } 51 | -------------------------------------------------------------------------------- /data/moviedata.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "title": "3-Idiots", 5 | "director": "Rajkumar Hirani", 6 | "genre": ["comedy"], 7 | "rating": "8.4", 8 | "description": "Two friends are searching for their long lost companion. They revisit their college days and recall the memories of their friend who inspired them to think differently, even as the rest of the world called them idiots." 9 | }, 10 | { 11 | "title": "Bajirao Mastani", 12 | "director": " Sanjay Leela Bhansali", 13 | "genre": ["historical", "drama"], 14 | "rating": "7.9", 15 | "description": "An account of the romance between the Maratha general, Baji Rao I and Mastani, princess of Bundelkhand." 16 | }, 17 | { 18 | "title": "Baahubali", 19 | "director": " S.S. Rajamouli", 20 | "genre": ["action", "drama"], 21 | "rating": "8.0", 22 | "description": "In ancient India, an adventurous and daring man becomes involved in a decades-old feud between two warring peoples." 23 | }, 24 | { 25 | "title": "Ajab Prem Ki Ghazab Kahani", 26 | "director": "Rajkumar Santoshi", 27 | "genre": ["romance"], 28 | "rating": "6.9", 29 | "description": "The wacky adventures of a young man who is willing to sacrifice his own love to insure the happiness of others, and get the girl-of-his-dreams married to the boy-of-her-dreams." 30 | }, 31 | { 32 | "title": "Zindagi Na Milegi Dobara", 33 | "director": "Zoya Aktar", 34 | "genre": ["romance"], 35 | "rating": "8.2", 36 | "description": "Three friends decide to turn their fantasy vacation into reality after one of their friends gets engaged." 37 | }, 38 | { 39 | "title": "Piku", 40 | "director": "Shoojit Sircar", 41 | "genre": ["comedy"], 42 | "rating": "7.9", 43 | "description": "A quirky comedy about the relationship between a daughter and her aging father, whose eccentricities drive everyone crazy." 44 | }, 45 | { 46 | "title": "Bhoothnath", 47 | "director": "Vivek Sharma", 48 | "genre": ["horror"], 49 | "rating": "6.3", 50 | "description": "Moving into a new house, a family witnesses an unfriendly ghost who wants to drive them away from the house. However, he befriends a little boy who changes his outlook forever." 51 | } 52 | ] 53 | } 54 | -------------------------------------------------------------------------------- /data/photodata.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "name": "red robot", 5 | "picture": "https://robohash.org/1" 6 | }, 7 | { 8 | "name": "yellow robot", 9 | "picture": "https://robohash.org/2" 10 | }, 11 | { 12 | "name": "purple male robot", 13 | "picture": "https://robohash.org/3" 14 | }, 15 | { 16 | "name": "purple female robot", 17 | "picture": "https://robohash.org/4" 18 | }, 19 | { 20 | "name": "green antena robot", 21 | "picture": "https://robohash.org/5" 22 | }, 23 | { 24 | "name": "yellow son robot", 25 | "picture": "https://robohash.org/6" 26 | }, 27 | { 28 | "name": "green uncle robot", 29 | "picture": "https://robohash.org/7" 30 | }, 31 | { 32 | "name": "gray robot", 33 | "picture": "https://robohash.org/8" 34 | }, 35 | { 36 | "name": "pink grand father robot", 37 | "picture": "https://robohash.org/9" 38 | }, 39 | { 40 | "name": "green small robot", 41 | "picture": "https://robohash.org/10" 42 | } 43 | ] 44 | } 45 | -------------------------------------------------------------------------------- /data/photofooddata.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "name": "pizza", 5 | "taste": "spicy", 6 | "picture": "https://source.unsplash.com/Oxb84ENcFfU/1600x900" 7 | }, 8 | { 9 | "name": "burger", 10 | "taste": "spicy", 11 | "picture": "https://b.zmtcdn.com/data/homepage_dish_data/4/6e69685d22c94ffd42ccd7e70e246bd9.png" 12 | }, 13 | { 14 | "name": "pasta", 15 | "taste": "spicy", 16 | "picture": "https://b.zmtcdn.com/data/dish_images/bbdabeeb71f0962aff2d87cfc57860061612437785.png" 17 | }, 18 | { 19 | "name": "chicken", 20 | "taste": "spicy", 21 | "picture": "https://b.zmtcdn.com/data/homepage_dish_data/4/742929dcb631403d7c1c1efad2ca2700.png" 22 | }, 23 | { 24 | "name": "chaat", 25 | "taste": "spicy", 26 | "picture": "https://b.zmtcdn.com/data/dish_images/aebeb88b78a4a83ea9e727f234899bed1602781186.png" 27 | }, 28 | { 29 | "name": "fried rice", 30 | "taste": "nutty", 31 | "picture": "https://b.zmtcdn.com/data/dish_images/924fb7dc50bb19b9cd01a1126bca234b1615960357.png" 32 | }, 33 | { 34 | "name": "falooda", 35 | "taste": "sweet", 36 | "picture": "https://b.zmtcdn.com/data/dish_photos/7ca/a98976a1fc56131e0dd0a0404867b7ca.jpg" 37 | }, 38 | { 39 | "name": "ice cream", 40 | "taste": "sweet", 41 | "picture": "https://source.unsplash.com/3w2AuRZeeSU/" 42 | }, 43 | { 44 | "name": "sandwich", 45 | "taste": "spicy", 46 | "picture": "https://b.zmtcdn.com/data/homepage_dish_data/4/4a04890400b5d7bac101baace5d7e994.png" 47 | }, 48 | { 49 | "name": "cake", 50 | "taste": "sweet", 51 | "picture": "https://source.unsplash.com/kPxsqUGneXQ/" 52 | }, 53 | { 54 | "name": "cold drink", 55 | "taste": "sweet", 56 | "picture": "https://source.unsplash.com/gjaQ7RnVIkM/" 57 | }, 58 | { 59 | "name": "juice", 60 | "taste": "sweet", 61 | "picture": "https://source.unsplash.com/C3aM2Nc7sbI/" 62 | }, 63 | { 64 | "name": "chapati", 65 | "taste": "nutty", 66 | "picture": "https://b.zmtcdn.com/data/dish_photos/db5/8490784a2b2e19ae5dfd2a22efb06db5.jpg" 67 | }, 68 | { 69 | "name": "dal fry", 70 | "taste": "spicy", 71 | "picture": "https://b.zmtcdn.com/data/dish_photos/45e/14b704acd26f122ebe4ac2f9eded045e.jpg" 72 | }, 73 | { 74 | "name": "Aloo Parantha", 75 | "taste": "spicy", 76 | "picture": "https://b.zmtcdn.com/data/dish_photos/001/44befd6cc12b983282bf943b0dcf4001.jpg" 77 | } 78 | ], 79 | "taste": ["spicy", "nutty", "sweet"] 80 | } 81 | -------------------------------------------------------------------------------- /data/productdata.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [{ 3 | "name": "school bag", 4 | "brand": "rockstore", 5 | "price": "999", 6 | "image": "https://unsplash.com/photos/_H0fjILH5Vw", 7 | "description": "The bag have 3 main zippered compartments, one well-padded laptop partition, 2 water bottle /umbrella pockets and Organizer Pockets inside. Suitable for casual usage, school / college / office n travel." 8 | }, 9 | { 10 | "name": "smart watch", 11 | "brand": "digital work", 12 | "price": "1299", 13 | "image": "https://unsplash.com/photos/UkO7K1CPFS8", 14 | "description": "The brilliant 1.3 colour display is now full capacitive touch, supporting taps and swipes, so it is easy to read and operate." 15 | }, 16 | { 17 | "name": "denim jacket", 18 | "brand": "fab fabric", 19 | "price": "1999", 20 | "image": "https://unsplash.com/photos/UNSj7BtOK0Q", 21 | "description": "Made with a Cotton blend, this denim jacket is designed with style and function in mind. Wear it out to lunch with friends or dress it up for date night, this essential staple can be worn for many occasions." 22 | }, 23 | { 24 | "name": "mouse pad", 25 | "brand": "electrika", 26 | "price": "499", 27 | "image": "https://unsplash.com/photos/PL6ClUWwDEw", 28 | "description": "Speed-type surface mousepad is designed with the use of great technology and craftsmanship especially for professional gamers." 29 | }, 30 | { 31 | "name": "gaming controller", 32 | "brand": "playclub", 33 | "price": "1599", 34 | "image": "https://unsplash.com/photos/UCFDB6O48d0", 35 | "description": "Experience the modernized design of the Xbox wireless controller in robot white, featuring sculpted surfaces and refined geometry for enhanced comfort and effortless control during gameplay." 36 | }, 37 | { 38 | "name": "digital camera", 39 | "brand": "electrika", 40 | "price": "5999", 41 | "image": "https://unsplash.com/photos/b8J3ert6B6s", 42 | "description": "Capturing sharp images is easy thanks to the fast, accurate AF and the large grip that provides a firm, steady hold on the camera. Built-in Wi-Fi / NFC connectivity enables the seamless upload of photos and videos to social media." 43 | }, 44 | { 45 | "name": "speaker", 46 | "brand": "digimob", 47 | "price": "10000", 48 | "image": "https://unsplash.com/photos/u8-QI4tRES0", 49 | "description": "A compact, lightweight and IPX 6 Water Resistant design makes it the perfect companion for a number of sceneries. Stay prepared with the boAt Stone 170. It is packed with an 1800mAh Battery, with a push of up to 6 hours of play time per listening session." 50 | }, 51 | { 52 | "name": "toothbrush", 53 | "brand": "kirana", 54 | "price": "50", 55 | "image": "https://unsplash.com/photos/GU626U1eTC0", 56 | "description": "With the unique cup shaped bristles it cleans in between teeth and along gum line to protect you against cavity." 57 | }, 58 | { 59 | "name": "notebook", 60 | "brand": "bookish", 61 | "price": "39", 62 | "image": "https://unsplash.com/photos/3ym6i13Y9LU", 63 | "description": "Bookish notebooks are made to the highest quality standards. Made from superior quality paper and pulp, the pages are whiter, brighter and smoother. The superior cut and excellent finish ensure the pages are in perfect alignment without any folded corners." 64 | }, 65 | { 66 | "name": "mechanical pencil", 67 | "brand": "bookish", 68 | "price": "199", 69 | "image": "https://unsplash.com/photos/DUOTbkFqvFw", 70 | "description": "Accessories made of matte brass. Clip made of matt stainless steel. Mini removable sharpener embedded in the feed button." 71 | } 72 | 73 | ] 74 | } -------------------------------------------------------------------------------- /data/showsdata.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [{ 3 | "title": "Friends", 4 | "genre": ["comedy", "romance"], 5 | "rating": "8.9", 6 | "season": "10", 7 | "episodes": "236", 8 | "description": "Ross Geller, Rachel Green, Monica Geller, Joey Tribbiani, Chandler Bing, and Phoebe Buffay are six 20 something year olds living in New York City. Over the course of 10 years and seasons, these friends go through family,love,drama,friendship and comedy." 9 | }, 10 | { 11 | "title": "Money Heist", 12 | "genre": ["drama", "thriller"], 13 | "rating": "8.3", 14 | "season": "2", 15 | "episodes": "31", 16 | "description": "Eight thieves take hostages and lock themselves in the Royal Mint of Spain as a criminal mastermind manipulates the police to carry out his plan." 17 | }, 18 | { 19 | "title": "Sherlock Homles", 20 | "genre": ["detective", "fiction"], 21 | "rating": "9.1", 22 | "season": "4", 23 | "episodes": "13", 24 | "description": "A modern update finds the famous sleuth and his doctor partner solving crime in 21st century London." 25 | }, 26 | { 27 | "title": "The Big Bang Theory", 28 | "genre": ["sitcom", "drama"], 29 | "rating": "8.1", 30 | "season": "12", 31 | "episodes": "279", 32 | "description": "A woman who moves into an apartment across the hall from two brilliant but socially awkward physicists shows them how little they know about life outside of the laboratory." 33 | }, 34 | { 35 | "title": "Little Things", 36 | "genre": ["comedy", "drama"], 37 | "rating": "8.3", 38 | "season": "3", 39 | "episodes": "21", 40 | "description": "A cohabiting couple in their 20s navigate the ups and downs of work, modern-day relationships and finding themselves in contemporary Bengaluru." 41 | }, 42 | { 43 | "title": "Suits", 44 | "genre": ["comedy", "legal drama"], 45 | "rating": "8.3", 46 | "season": "9", 47 | "episodes": "134", 48 | "description": "On the run from a drug deal gone bad, brilliant college dropout Mike Ross, finds himself working with Harvey Specter, one of New York City's best lawyers." 49 | }, 50 | { 51 | "title": "Breaking Bad", 52 | "genre": ["thriller", "suspense", "drama", "dark comedy"], 53 | "rating": "9.5", 54 | "season": "5", 55 | "episodes": "62", 56 | "description": "A high school chemistry teacher diagnosed with inoperable lung cancer turns to manufacturing and selling methamphetamine in order to secure his family's future." 57 | }, 58 | { 59 | "title": "The Office", 60 | "genre": ["comedy", "drama", "romance"], 61 | "rating": "8.9", 62 | "season": "9", 63 | "episodes": "201", 64 | "description": "A mockumentary on a group of typical office workers, where the workday consists of ego clashes, inappropriate behavior, and tedium." 65 | }, 66 | { 67 | "title": "Game of Thrones", 68 | "genre": ["comedy", "drama", "epic", "suspense"], 69 | "rating": "9.3", 70 | "season": "8", 71 | "episodes": "73", 72 | "description": "Nine noble families fight for control over the lands of Westeros, while an ancient enemy returns after being dormant for millennia." 73 | } 74 | ] 75 | } -------------------------------------------------------------------------------- /data/songdata.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "name": "Chan Kitta", 5 | "singer": "Ayushmann Khurrana", 6 | "language": "punjabi", 7 | "genre": "romance", 8 | "link": "https://www.youtube.com/watch?v=JFYCc577kjQ" 9 | }, 10 | { 11 | "name": "Afreen Afreem", 12 | "singer": "Rahat Fateh Ali Khan", 13 | "language": "urdu", 14 | "genre": "ghazal", 15 | "link": "https://www.youtube.com/watch?v=kw4tT7SCmaY" 16 | }, 17 | { 18 | "name": "Lut Gaye", 19 | "singer": "Jubin Nautiyal", 20 | "language": "hindi", 21 | "genre": "romance", 22 | "link": "https://www.youtube.com/watch?v=sCbbMZ-q4-I" 23 | }, 24 | { 25 | "name": "Dope Shope", 26 | "singer": "Yo Yo Honey Singh", 27 | "language": "punjabi", 28 | "genre": "pop", 29 | "link": "https://www.youtube.com/watch?v=NrXdauEv9HY" 30 | }, 31 | { 32 | "name": "Tunak Tunak Tun", 33 | "singer": "Daler Mehndi", 34 | "language": "punjabi", 35 | "genre": "indian pop", 36 | "link": "https://www.youtube.com/watch?v=vTIIMJ9tUc8" 37 | }, 38 | { 39 | "name": "Bohemian Rhapsody", 40 | "singer": "Queen", 41 | "language": "english", 42 | "genre": "classic rock", 43 | "link": "https://www.youtube.com/watch?v=fJ9rUzIMcZQ" 44 | }, 45 | { 46 | "name": "Oonchi Hai Building", 47 | "singer": "Anu Malik", 48 | "language": "hindi", 49 | "genre": "pop", 50 | "link": "https://www.youtube.com/watch?v=QmHTmr8Kazs" 51 | }, 52 | { 53 | "name": "Brown Munde", 54 | "singer": "AP DHILLON", 55 | "language": "punjabi", 56 | "genre": "pop", 57 | "link": "https://www.youtube.com/watch?v=VNs_cCtdbPc" 58 | }, 59 | { 60 | "name": "Kun Faya Kun", 61 | "singer": "A.R. Rahman", 62 | "language": "urdu", 63 | "genre": "sufi", 64 | "link": "https://www.youtube.com/watch?v=T94PHkuydcw" 65 | }, 66 | { 67 | "name": "Tera Yaar Hoon Main", 68 | "singer": "Arijit Singh", 69 | "language": "hindi", 70 | "genre": "friendship", 71 | "link": "https://www.youtube.com/watch?v=EatzcaVJRMs" 72 | } 73 | ] 74 | } 75 | -------------------------------------------------------------------------------- /data/taskdata.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "task_name": "reading", 5 | "completed": true, 6 | "details": "keep up with the world and broaden your horizons" 7 | }, 8 | 9 | { 10 | "task_name": "drinking", 11 | "completed": true, 12 | "details": "drink delicious chai or coffee" 13 | }, 14 | 15 | { 16 | "task_name": "eating", 17 | "completed": false, 18 | "details": "having nice and healthy food" 19 | }, 20 | 21 | { 22 | "task_name": "sleeping", 23 | "completed": true, 24 | "details": "have a good sleep" 25 | }, 26 | 27 | { 28 | "task_name": "writing", 29 | "completed": true, 30 | "details": "write a diary entry or blog posts to have thoughts organized" 31 | }, 32 | 33 | { 34 | "task_name": "smile", 35 | "completed": true, 36 | "details": "smile and spreading happiness" 37 | }, 38 | 39 | { 40 | "task_name": "walking", 41 | "completed": false, 42 | "details": "take a walk and feel refreshed" 43 | }, 44 | 45 | { 46 | "task_name": "working", 47 | "completed": false, 48 | "details": "work on projects" 49 | }, 50 | 51 | { 52 | "task_name": "learning", 53 | "completed": true, 54 | "details": "learn something new" 55 | }, 56 | 57 | { 58 | "task_name": "procrastinating", 59 | "completed": false, 60 | "details": "procrastinate once in a while" 61 | } 62 | ] 63 | } 64 | -------------------------------------------------------------------------------- /data/userdata.json: -------------------------------------------------------------------------------- 1 | { 2 | "page": 1, 3 | "data": [ 4 | { 5 | "first_name": "Becky", 6 | "last_name": "Blasbad", 7 | "email": "beck1blas4@gmail.com", 8 | "country":"India", 9 | "occupation":"engineer", 10 | "phoneno":"4248930799", 11 | "gender":"m", 12 | "dob":"1996-01-17" 13 | }, 14 | { 15 | "first_name": "Andry", 16 | "last_name": "Gentry", 17 | "email": "Anrygen002@gmail.com", 18 | "country":"China", 19 | "occupation":"cinematographer", 20 | "phoneno":"77885836672", 21 | "gender":"f", 22 | "dob":"1994-03-17" 23 | }, 24 | { 25 | "first_name": "David", 26 | "last_name": "Griffin", 27 | "email": "Devdavid9@gmail.com", 28 | "country":"England", 29 | "occupation":"footballer", 30 | "phoneno":"3209412679", 31 | "gender":"m", 32 | "dob":"1995-05-17" 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp') 2 | const terser = require('gulp-terser') 3 | var ts = require('gulp-typescript') 4 | const imagemin = require('gulp-imagemin') 5 | 6 | var tsProject = ts.createProject('tsconfig.json') 7 | 8 | gulp.task('copy', async function () { 9 | gulp.src('./src/public/fonts/*').pipe(gulp.dest('./dist/public/fonts')) 10 | gulp.src('./src/public/stylesheets/*.css').pipe(gulp.dest('./dist/public/stylesheets')) 11 | gulp.src('./src/views/*.ejs').pipe(gulp.dest('./dist/views')) 12 | }) 13 | 14 | gulp.task('uglify', async function () { 15 | gulp.src('./src/public/scripts/*.js').pipe(terser()).pipe(gulp.dest('./dist/public/scripts')) 16 | }) 17 | 18 | gulp.task('compress-img', async function () { 19 | gulp.src('./src/public/images/*').pipe(imagemin()).pipe(gulp.dest('./dist/public/images')) 20 | }) 21 | 22 | gulp.task('ts-compile', function () { 23 | return tsProject.src().pipe(tsProject()).js.pipe(gulp.dest('dist')) 24 | }) 25 | 26 | gulp.task('build', gulp.series('copy', 'uglify', 'compress-img', 'ts-compile')) 27 | 28 | gulp.task('default', gulp.series('build')) 29 | -------------------------------------------------------------------------------- /logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adityabisoi/json-hub/d547715ab2c8d24d5870724b70f3213ae76f8d5f/logo.jpg -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "json-hub", 3 | "version": "1.0.0", 4 | "description": "A NodeJS based REST API service for development and testing", 5 | "main": "server.js", 6 | "scripts": { 7 | "start": "node dist/server.js", 8 | "dev": "nodemon src/server.ts", 9 | "lint": "eslint .", 10 | "build": "tsc && cp ./src/views/index.ejs ./dist/views && cp -r ./src/public ./dist", 11 | "postinstall": "npm run build", 12 | "test": "jest" 13 | }, 14 | "repository": { 15 | "type": "git", 16 | "url": "git+https://github.com/adityabisoi/json-hub.git" 17 | }, 18 | "author": "Aditya Bisoi", 19 | "license": "ISC", 20 | "bugs": { 21 | "url": "https://github.com/adityabisoi/json-hub/issues" 22 | }, 23 | "homepage": "https://github.com/adityabisoi/json-hub#readme", 24 | "dependencies": { 25 | "dateformat": "^5.0.3", 26 | "dotenv": "^16.0.1", 27 | "ejs": "^3.1.8", 28 | "express": "^4.18.1", 29 | "morgan": "^1.10.0" 30 | }, 31 | "devDependencies": { 32 | "@types/express": "^4.17.13", 33 | "@types/morgan": "^1.9.3", 34 | "@types/node": "^18.6.3", 35 | "@typescript-eslint/eslint-plugin": "^5.31.0", 36 | "@typescript-eslint/parser": "^5.31.0", 37 | "eslint": "^8.20.0", 38 | "eslint-config-prettier": "^8.5.0", 39 | "eslint-plugin-import": "^2.26.0", 40 | "eslint-plugin-json": "^3.1.0", 41 | "eslint-plugin-prettier": "^4.2.1", 42 | "gulp": "^4.0.2", 43 | "gulp-imagemin": "^8.0.0", 44 | "gulp-terser": "^2.1.0", 45 | "gulp-typescript": "^6.0.0-alpha.1", 46 | "husky": "^4.2.5", 47 | "jest": "^28.1.3", 48 | "nodemon": "^2.0.19", 49 | "prettier": "^2.7.1", 50 | "prettier-eslint": "^15.0.1", 51 | "supertest": "^6.2.4", 52 | "ts-node": "^10.9.1", 53 | "typescript": "^4.7.4" 54 | }, 55 | "husky": { 56 | "hooks": { 57 | "pre-commit": "npm run lint" 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/api/routes/books.ts: -------------------------------------------------------------------------------- 1 | import express, { Application, NextFunction, Request, Response } from 'express' 2 | const data = require('../../../data/bookdata.json') 3 | 4 | const router = express.Router() 5 | 6 | router.get('/', (req: Request, res: Response, next: NextFunction) => { 7 | try { 8 | if (Object.keys(req.query).length) { 9 | const author: any = req.query.author 10 | const price: any = req.query.price 11 | const title: any = req.query.title 12 | if (!author && !price && !title) { 13 | res.status(404).json({ message: 'Invalid query data' }) 14 | } else { 15 | const result = data.data 16 | .filter((book: any) => book.author === (author ?? book.author)) 17 | .filter((book: any) => book.price === (price ?? book.price)) 18 | .filter((book: any) => book.title === (title ?? book.title)) 19 | if (result.length) res.status(200).json({ data: result }) 20 | else res.status(204).json({ message: 'No record found' }) 21 | } 22 | } else { 23 | res.status(200).json(data) 24 | } 25 | } catch (err) { 26 | res.status(500).json({ 27 | error: err, 28 | }) 29 | } 30 | }) 31 | 32 | router.get('/:id', (req: Request, res: Response, next: NextFunction) => { 33 | try { 34 | const id: number = parseInt(req.params.id) 35 | const size = data.data.length 36 | 37 | if (id < size) { 38 | res.status(200).json({ data: data.data[id] }) 39 | } else { 40 | res.status(404).json({ message: 'No data found at the given index' }) 41 | } 42 | } catch (err) { 43 | res.status(500).json({ 44 | error: err, 45 | }) 46 | } 47 | }) 48 | module.exports = router 49 | -------------------------------------------------------------------------------- /src/api/routes/comments.ts: -------------------------------------------------------------------------------- 1 | import express, { Application, NextFunction, Request, Response } from 'express' 2 | const router = express.Router() 3 | const path = require('path') 4 | 5 | //importing file reader fs 6 | const fs = require('fs') 7 | 8 | //endpoint for /GET requests for comments 9 | router.get('/', (req: Request, res: Response, next: NextFunction) => { 10 | //reading the contents of comments json file 11 | fs.readFile(path.resolve(__dirname, '../../../data/commentdata.json'), (err: string, data: string) => { 12 | if (err) { 13 | console.log(err) 14 | return res.status(500).json({ 15 | error: err, 16 | }) 17 | } 18 | //parsing through the data and sending response 19 | const comments = JSON.parse(data) 20 | res.status(200).json(comments) 21 | }) 22 | }) 23 | 24 | module.exports = router 25 | -------------------------------------------------------------------------------- /src/api/routes/foodphotos.ts: -------------------------------------------------------------------------------- 1 | import express, { Application, NextFunction, Request, Response } from 'express' 2 | const data = require('../../../data/photofooddata.json') 3 | 4 | const router = express.Router() 5 | 6 | /* 7 | 8 | /photos/food/taste -> send all the taste category 9 | 10 | 11 | /photos/food -> send all the food items 12 | 13 | 14 | /photos/food?taste={category} -> send items of specific category food 15 | 16 | 17 | */ 18 | 19 | // GET request /photos/food/taste route -> available category 20 | router.get('/taste', (req: Request, res: Response, next: NextFunction) => { 21 | try { 22 | res.status(200).json({ data: data.taste }) 23 | } catch (err) { 24 | //error handling 25 | console.log(err) 26 | res.status(500).json({ 27 | error: err, 28 | }) 29 | } 30 | }) 31 | 32 | // GET request /photos/food route 33 | router.get('/', (req: Request, res: Response, next: NextFunction) => { 34 | try { 35 | //if query parameters does not exist then send all food items 36 | if (!req.query.taste) { 37 | res.status(200).json({ data: data.data }) 38 | } 39 | // If query parameters exist then sending that type of food object 40 | else { 41 | const sendData: Array = [] 42 | data.data.forEach((element: any) => { 43 | if (element.taste === req.query.taste) { 44 | sendData.push(element) 45 | } 46 | }) 47 | res.status(200).json({ data: sendData }) 48 | } 49 | } catch (err) { 50 | //error handling 51 | console.log(err) 52 | res.status(500).json({ 53 | error: err, 54 | }) 55 | } 56 | }) 57 | 58 | module.exports = router 59 | -------------------------------------------------------------------------------- /src/api/routes/home.ts: -------------------------------------------------------------------------------- 1 | import express, { Application, NextFunction, Request, Response } from 'express' 2 | //data to be shown on website 3 | import data from '../../views/data' 4 | const router = express.Router() 5 | 6 | router.get('/', (req: Request, res: Response, next: NextFunction) => { 7 | //var fullUrl = req.protocol + '://' + req.get('host') + req.originalUrl 8 | // res.send(`GET (Valid): ${fullUrl}users`) 9 | res.render('index', { data: data }) 10 | }) 11 | 12 | module.exports = router 13 | -------------------------------------------------------------------------------- /src/api/routes/photos.ts: -------------------------------------------------------------------------------- 1 | import express, { Application, NextFunction, Request, Response } from 'express' 2 | const data = require('../../../data/photodata.json') 3 | 4 | const router = express.Router() 5 | 6 | // GET request /photos route 7 | router.get('/', (req: Request, res: Response, next: NextFunction) => { 8 | try { 9 | res.status(200).json(data) 10 | } catch (err) { 11 | //error handling 12 | console.log(err) 13 | res.status(500).json({ 14 | error: err, 15 | }) 16 | } 17 | }) 18 | router.get('/:id', (req: Request, res: Response, next: NextFunction) => { 19 | const idx: number = parseInt(req.params.id) 20 | const size = data.data.length 21 | try { 22 | if (idx >= size) { 23 | res.status(404).json({ message: 'No data found at the given index' }) 24 | } else { 25 | let count: any = req.query.count 26 | if (count) { 27 | count = parseInt(count) 28 | const result = [] 29 | for (let i: number = idx; i < size && i <= idx + count; i++) { 30 | result.push(data.data[i]) 31 | } 32 | res.status(200).json({ data: result }) 33 | } else { 34 | res.status(200).json({ data: data.data[idx] }) 35 | } 36 | } 37 | } catch (err) { 38 | res.status(500).json({ error: err }) 39 | } 40 | }) 41 | module.exports = router 42 | -------------------------------------------------------------------------------- /src/api/routes/products.ts: -------------------------------------------------------------------------------- 1 | import express, { Application, NextFunction, Request, Response } from 'express' 2 | const data = require('../../../data/productdata.json') 3 | 4 | const router = express.Router() 5 | 6 | //GET request /products route 7 | router.get('/', (req: Request, res: Response, next: NextFunction) => { 8 | try { 9 | res.status(200).json(data) 10 | } catch (err) { 11 | console.log(err) 12 | res.status(500).json({ 13 | error: err, 14 | }) 15 | } 16 | }) 17 | 18 | //GET request/products/:id route 19 | router.get('/:id', (req: Request, res: Response, next: NextFunction) => { 20 | try { 21 | const id: any = req.params.id 22 | if (id < data.data.length) { 23 | res.status(200).json({ data: data.data[id] }) 24 | } else { 25 | res.status(404).json({ message: 'No data found at the given index' }) 26 | } 27 | } catch (err) { 28 | console.log(err) 29 | res.status(500).json({ 30 | error: err, 31 | }) 32 | } 33 | }) 34 | 35 | module.exports = router 36 | -------------------------------------------------------------------------------- /src/api/routes/shows.ts: -------------------------------------------------------------------------------- 1 | import express, { Application, NextFunction, Request, Response } from 'express' 2 | const data = require('../../../data/showsdata.json') 3 | 4 | const router = express.Router() 5 | 6 | //GET request /shows route 7 | router.get('/', (req: Request, res: Response, next: NextFunction) => { 8 | try { 9 | const genre: any = req.query.genre 10 | const season: any = req.query.season 11 | const rating: any = req.query.rating 12 | if (Object.keys(req.query).length) { 13 | if (!genre && !season && !rating) res.status(404).json({ message: 'Invalid query' }) 14 | else { 15 | let result = data.data 16 | .filter((shows: any) => shows.season === (season ?? shows.season)) 17 | .filter((shows: any) => shows.rating === (rating ?? shows.rating)) 18 | if (genre) result = data.data.filter((shows: any) => shows.genre.includes(genre)) 19 | 20 | if (result.length) res.status(200).json({ data: result }) 21 | else res.status(204).json({ message: 'No data found' }) 22 | } 23 | } else { 24 | res.status(200).json(data) 25 | } 26 | } catch (err) { 27 | console.log(err) 28 | res.status(500).json({ 29 | error: err, 30 | }) 31 | } 32 | }) 33 | 34 | //GET request/shows/:id route 35 | router.get('/:id', (req: Request, res: Response, next: NextFunction) => { 36 | try { 37 | const id: any = req.params.id 38 | if (id < data.data.length) { 39 | res.status(200).json({ data: data.data[id] }) 40 | } else { 41 | res.status(404).json({ message: 'No data found at the given index' }) 42 | } 43 | } catch (err) { 44 | console.log(err) 45 | res.status(500).json({ 46 | error: err, 47 | }) 48 | } 49 | }) 50 | 51 | module.exports = router 52 | -------------------------------------------------------------------------------- /src/api/routes/songs.ts: -------------------------------------------------------------------------------- 1 | import express, { Application, NextFunction, Request, Response } from 'express' 2 | const data = require('../../../data/songdata.json') 3 | 4 | const router = express.Router() 5 | 6 | // GET request /songs 7 | router.get('/', (req: Request, res: Response, next: NextFunction) => { 8 | try { 9 | if (Object.keys(req.query).length) { 10 | const artist: any = req.query.artist 11 | const genre: any = req.query.genre 12 | const language: any = req.query.language 13 | if (!artist && !genre && !language) { 14 | res.status(404).json({ message: 'Invalid query data' }) 15 | } else { 16 | const result = data.data 17 | .filter((song: any) => song.singer === (artist ?? song.singer)) 18 | .filter((song: any) => song.genre === (genre ?? song.genre)) 19 | .filter((song: any) => song.language === (language ?? song.language)) 20 | 21 | if (result.length) res.status(200).json({ data: result }) 22 | else res.status(204).json({ message: 'No record found' }) 23 | } 24 | } else { 25 | res.status(200).json(data) 26 | } 27 | } catch (err) { 28 | console.log(err) 29 | res.status(500).json({ 30 | error: err, 31 | }) 32 | } 33 | }) 34 | router.get('/:id', (req: Request, res: Response, next: NextFunction) => { 35 | try { 36 | const id: any = req.params.id 37 | if (id < data.data.length) { 38 | res.status(200).json({ data: data.data[id] }) 39 | } else { 40 | res.status(404).json({ message: 'Invalid Id' }) 41 | } 42 | } catch (err) { 43 | console.log(err) 44 | res.status(500).json({ 45 | error: err, 46 | }) 47 | } 48 | }) 49 | module.exports = router 50 | -------------------------------------------------------------------------------- /src/api/routes/tasks.ts: -------------------------------------------------------------------------------- 1 | import express, { Application, NextFunction, Request, Response } from 'express' 2 | const data = require('../../../data/taskdata.json') 3 | 4 | const router = express.Router() 5 | 6 | // GET request /tasks route 7 | router.get('/', (req: Request, res: Response, next: NextFunction) => { 8 | try { 9 | const count: any = req.query.count 10 | // console.log("/-count: ", count); 11 | if (count) { 12 | const result = [] 13 | for (let i: any = 0; i < parseInt(count) && i < data.data.length; i++) { 14 | result.push(data.data[i]) 15 | } 16 | res.status(200).json({ data: result }) 17 | } else { 18 | res.status(200).json(data) 19 | } 20 | } catch (err) { 21 | //error handling 22 | // console.log(err); 23 | res.status(500).json({ 24 | error: err, 25 | }) 26 | } 27 | }) 28 | 29 | //GET request /tasks/index 30 | router.get('/:index', (req: Request, res: Response, next: NextFunction) => { 31 | try { 32 | const idx: number = parseInt(req.params.index) 33 | const count: any = req.query.count 34 | // console.log("index: ", idx) 35 | // console.log("count: ", count); 36 | if (data.data.length > idx) { 37 | if (count) { 38 | const result = [] 39 | const size: number = idx + parseInt(count) 40 | for (let i: any = idx; i < size && i < data.data.length; i++) { 41 | // console.log("insdie loop: ", data.data[i]); 42 | result.push(data.data[i]) 43 | } 44 | res.status(200).json({ data: result }) 45 | } else { 46 | res.status(200).json({ data: data.data[idx] }) 47 | } 48 | } else { 49 | res.status(404).json({ message: 'No data found at the given index' }) 50 | } 51 | } catch (err) { 52 | console.log('tasks: ', err) 53 | res.status(500).json({ 54 | error: err, 55 | }) 56 | } 57 | }) 58 | 59 | module.exports = router 60 | -------------------------------------------------------------------------------- /src/api/routes/users.ts: -------------------------------------------------------------------------------- 1 | import express, { NextFunction, Request, Response } from 'express' 2 | const data = require('../../../data/userdata.json') 3 | 4 | const router = express.Router() 5 | 6 | // GET request /photos route 7 | router.get('/', (req: Request, res: Response, next: NextFunction) => { 8 | try { 9 | res.status(200).json(data) 10 | } catch (err) { 11 | //error handling 12 | console.log(err) 13 | res.status(500).json({ 14 | error: err, 15 | }) 16 | } 17 | }) 18 | router.get('/:id', (req: Request, res: Response, next: NextFunction) => { 19 | const idx: number = parseInt(req.params.id) 20 | const size = data.data.length 21 | try { 22 | if (idx >= size) { 23 | res.status(404).json({ message: 'No data found at the given index' }) 24 | } else { 25 | let count: any = req.query.count 26 | if (count) { 27 | count = parseInt(count) 28 | const result = [] 29 | for (let i: number = idx; i < size && i <= idx + count; i++) { 30 | result.push(data.data[i]) 31 | } 32 | res.status(200).json({ data: result }) 33 | } else { 34 | res.status(200).json({ data: data.data[idx] }) 35 | } 36 | } 37 | } catch (err) { 38 | res.status(500).json({ error: err }) 39 | } 40 | }) 41 | module.exports = router 42 | -------------------------------------------------------------------------------- /src/api/routes/vehicles.ts: -------------------------------------------------------------------------------- 1 | import express, { Application, NextFunction, Request, Response } from 'express' 2 | import { monitorEventLoopDelay } from 'node:perf_hooks' 3 | const data = require('../../../data/vehicledata.json') 4 | 5 | const router = express.Router() 6 | 7 | // vehicles/ -> send all the vehicle data 8 | 9 | router.get('/', (req: Request, res: Response, next: NextFunction) => { 10 | try { 11 | const manufacturer: any = req.query.manufacturer 12 | const result = [] 13 | if (manufacturer !== undefined) { 14 | for (let i: any = 0; i < data.data.length; i++) { 15 | if (data.data[i].manufacturer === manufacturer) { 16 | result.push(data.data[i]) 17 | } 18 | } 19 | if (result.length) { 20 | res.status(200).json({ data: result }) 21 | } else { 22 | res.status(400).json({ message: 'invalid request' }) 23 | } 24 | } else { 25 | res.status(200).json(data) 26 | } 27 | } catch (err) { 28 | res.status(500).json({ error: err }) 29 | } 30 | }) 31 | 32 | router.get('/:id', (req: Request, res: Response, next: NextFunction) => { 33 | try { 34 | const idx: number = parseInt(req.params.id) 35 | if (idx < data.data.length) { 36 | res.status(200).json({ data: data.data[idx] }) 37 | } else { 38 | res.status(200).json(data) 39 | } 40 | } catch (err) { 41 | res.status(500).json({ error: err }) 42 | } 43 | }) 44 | 45 | module.exports = router 46 | -------------------------------------------------------------------------------- /src/app.ts: -------------------------------------------------------------------------------- 1 | import express, { Application, NextFunction, Request, RequestHandler, Response } from 'express' 2 | import morgan from 'morgan' 3 | import path from 'path' 4 | 5 | const app: Application = express() 6 | app.use(express.static(__dirname + '/public')) 7 | app.set('views', path.join(__dirname, 'views')) 8 | app.set('view engine', 'ejs') 9 | 10 | const homeRoute = require('./api/routes/home') 11 | const usersRoute = require('./api/routes/users') 12 | const taskRoute = require('./api/routes/tasks') //include tasks route 13 | const commentRoute = require('./api/routes/comments') //importing the comments endpoint file 14 | const photoRoute = require('./api/routes/photos') 15 | const foodPhotoRoute = require('./api/routes/foodphotos') //include foodphotos route 16 | const songRoute = require('./api/routes/songs') //include songs route 17 | const bookRoute = require('./api/routes/books') //include books route 18 | const showsRoute = require('./api/routes/shows') //include shows route 19 | 20 | app.use(morgan('dev') as RequestHandler) 21 | app.use(express.json() as RequestHandler) 22 | app.use( 23 | express.urlencoded({ 24 | extended: false, 25 | }) as RequestHandler 26 | ) 27 | 28 | // Add CORS 29 | app.use((req: Request, res: Response, next: NextFunction) => { 30 | res.header('Access-Control-Allow-Origin', '*') 31 | res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept, Authorization') 32 | if (req.method === 'OPTIONS') { 33 | res.header('Access-Control-Allow-Methods', 'GET, POST, PUT, PATCH, DELETE') 34 | return res.status(200).json({}) 35 | } 36 | next() 37 | }) 38 | 39 | // Routes to handle requests 40 | app.use('/', homeRoute) 41 | app.use('/users', usersRoute) 42 | app.use('/tasks', taskRoute) // Added task route 43 | app.use('/comments', commentRoute) //Routing the app to use the comments endpoint 44 | app.use('/photos/food', foodPhotoRoute) //Added foodphoto route 45 | app.use('/photos', photoRoute) 46 | app.use('/songs', songRoute) 47 | app.use('/songs', songRoute) 48 | app.use('/shows', showsRoute) 49 | app.use('/books', bookRoute) //Added books route 50 | 51 | // Handle error 52 | interface ErrorWithStatus extends Error { 53 | status: number 54 | } 55 | 56 | app.use((req: Request, res: Response, next: NextFunction) => { 57 | const error = new Error('Not found') as ErrorWithStatus 58 | error.status = 404 59 | next(error) 60 | }) 61 | 62 | app.use((error: ErrorWithStatus, req: Request, res: Response, next: NextFunction) => { 63 | res.status(error.status || 500).json({ 64 | error: { 65 | message: error.message, 66 | }, 67 | }) 68 | }) 69 | 70 | module.exports = app 71 | -------------------------------------------------------------------------------- /src/public/fonts/terminal-font.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adityabisoi/json-hub/d547715ab2c8d24d5870724b70f3213ae76f8d5f/src/public/fonts/terminal-font.woff -------------------------------------------------------------------------------- /src/public/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adityabisoi/json-hub/d547715ab2c8d24d5870724b70f3213ae76f8d5f/src/public/images/favicon.ico -------------------------------------------------------------------------------- /src/public/scripts/script.js: -------------------------------------------------------------------------------- 1 | var app = document.getElementById('app') 2 | var customNodeCreator = function (character) { 3 | return document.createTextNode(character) 4 | } 5 | 6 | var typewriter = new Typewriter(app, { 7 | loop: true, 8 | delay: 75, 9 | onCreateTextNode: customNodeCreator, 10 | }) 11 | 12 | typewriter.typeString('JSON Hub').pauseFor(2000).start() 13 | 14 | function toggle(idx) { 15 | console.log('button clicked', $('#btn' + idx).html()) 16 | 17 | $('#btn' + idx).html() === 'READ MORE' ? $('#btn' + idx).html('READ LESS') : $('#btn' + idx).html('READ MORE') 18 | $('#' + idx).toggle(1000) 19 | } 20 | -------------------------------------------------------------------------------- /src/public/stylesheets/master.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: "terminal"; 3 | src: url("/fonts/terminal-font.woff"); 4 | } 5 | body { 6 | background-color: #313131; 7 | color: white; 8 | font-family: "terminal"; 9 | margin: 0; 10 | } 11 | 12 | .header { 13 | display: block; 14 | background: linear-gradient(-45deg, #23a6d5, #23d5ab); 15 | background-size: 400% 400%; 16 | animation: gradient 15s ease infinite; 17 | padding-bottom: 2vh; 18 | } 19 | 20 | @keyframes gradient { 21 | 0% { 22 | background-position: 0% 50%; 23 | } 24 | 50% { 25 | background-position: 100% 50%; 26 | } 27 | 100% { 28 | background-position: 0% 50%; 29 | } 30 | } 31 | /*--- Navbar ---*/ 32 | .main-nav { 33 | float: right; 34 | margin-top: 2vh; 35 | padding-right: 2vh; 36 | } 37 | .main-nav li { 38 | display: inline; 39 | margin-left: 5vh; 40 | font-size: 1.2em; 41 | } 42 | .main-nav li a:link, 43 | .main-nav li a:visited { 44 | text-decoration: none; 45 | color: #fff; 46 | text-transform: uppercase; 47 | border-bottom: 2px solid transparent; 48 | padding-bottom: 10px; 49 | transition: border-bottom 0.5s; 50 | } 51 | .main-nav li a:hover, 52 | .main-nav li a:active { 53 | text-decoration: none; 54 | color: #fff; 55 | text-transform: uppercase; 56 | border-bottom: 2px solid white; 57 | } 58 | /* ---Navbar end--- */ 59 | .title { 60 | padding-top: 7vh; 61 | margin-top: 0; 62 | margin-bottom: 5vh; 63 | font-size: 5em; 64 | font-weight: 0.1em; 65 | text-align: center; 66 | color: white; 67 | } 68 | .header-content { 69 | margin-bottom: 2vh; 70 | } 71 | .header-content a { 72 | color: white; 73 | } 74 | .description { 75 | text-align: justify; 76 | font-size: 1.5em; 77 | color: white; 78 | margin: 0vh 20vw; 79 | text-align: center; 80 | } 81 | 82 | #detail { 83 | font-size: 1.2em; 84 | } 85 | 86 | .icons { 87 | text-align: center; 88 | font-size: 2em; 89 | } 90 | .container { 91 | padding: 5vh; 92 | } 93 | .content { 94 | margin-bottom: 2vh; 95 | } 96 | 97 | .routes { 98 | display: none; 99 | } 100 | .container .btn { 101 | text-decoration: none; 102 | background-color: transparent; 103 | text-transform: uppercase; 104 | border: 1px solid white; 105 | border-radius: 5px; 106 | padding: 1vh; 107 | font-size: 0.8em; 108 | color: white; 109 | } 110 | 111 | .btn:hover { 112 | background-color: white; 113 | color: black; 114 | } 115 | 116 | .row { 117 | display: flex; 118 | } 119 | 120 | .left-section { 121 | flex: 50%; 122 | } 123 | .right-section { 124 | flex: 50%; 125 | padding: 2vh; 126 | } 127 | .wrap { 128 | width: 30vw; 129 | margin: auto; 130 | align-items: center; 131 | } 132 | 133 | .terminal-bar { 134 | width: 100%; 135 | height: 35px; 136 | background: linear-gradient(270deg, #ebebeb, #d4d4d4); 137 | margin: 0 auto; 138 | float: none; 139 | 140 | border-radius: 10px 10px 0 0; 141 | } 142 | .terminal-bar-red, 143 | .terminal-bar-yellow, 144 | .terminal-bar-green { 145 | border-radius: 100%; 146 | width: 15px; 147 | height: 15px; 148 | position: relative; 149 | } 150 | .terminal-bar-red { 151 | background-color: #ff6261; 152 | top: 10px; 153 | left: 10px; 154 | } 155 | .terminal-bar-yellow { 156 | background-color: #ffc134; 157 | top: -5px; 158 | left: 35px; 159 | } 160 | .terminal-bar-green { 161 | background-color: #2dcc46; 162 | top: -20px; 163 | left: 60px; 164 | } 165 | .terminal-content { 166 | background-color: #122026; 167 | border-radius: 0 0 10px 10px; 168 | margin: 0 auto; 169 | padding: 1em; 170 | color: #fff; 171 | font-family: monospace; 172 | font-size: 15px; 173 | height: 30vh; 174 | overflow: auto; 175 | } 176 | .terminal-content p { 177 | margin: 0; 178 | line-height: 1.6em; 179 | } 180 | footer { 181 | background-color: white; 182 | color: black; 183 | padding: 0.7vh; 184 | font-size: 1.3em; 185 | text-align: center; 186 | } 187 | 188 | @media screen and (max-width: 991px) { 189 | .description { 190 | display: none !important; 191 | } 192 | .row { 193 | flex-wrap: wrap; 194 | } 195 | .title { 196 | font-size: 2em; 197 | } 198 | .wrap { 199 | width: 70vw; 200 | } 201 | } 202 | -------------------------------------------------------------------------------- /src/server.ts: -------------------------------------------------------------------------------- 1 | import http from 'http' 2 | const app = require('./app') 3 | 4 | // Define port 5 | const port = process.env.PORT || 5000 6 | 7 | const server = http.createServer(app) 8 | server.listen(port, () => { 9 | console.log(`Server running on port ${port}`) 10 | }) 11 | -------------------------------------------------------------------------------- /src/views/data.ts: -------------------------------------------------------------------------------- 1 | const data = [ 2 | { 3 | heading: 'Photos', 4 | desc: 'Returns pictures with names and links', 5 | routes: [ 6 | { 7 | route: 'GET /photos/', 8 | content: 'Return all the available photo data.', 9 | output: ` 10 | [ 11 | { 12 | "name": "red robot", 13 | "picture": "https://robohash.org/1" 14 | }, 15 | { 16 | "name": "yellow robot", 17 | "picture": "https://robohash.org/2" 18 | }, 19 | { 20 | "name": "purple male robot", 21 | "picture": "https://robohash.org/3" 22 | }, 23 | { 24 | "name": "purple female robot", 25 | "picture": "https://robohash.org/4" 26 | }, 27 | { 28 | "name": "green antena robot", 29 | "picture": "https://robohash.org/5" 30 | }, 31 | { 32 | "name": "yellow son robot", 33 | "picture": "https://robohash.org/6" 34 | } 35 | ]`, 36 | }, 37 | { 38 | route: 'GET /photos/2', 39 | content: 'Returns the photo at index 2 as specified in photodata.json.', 40 | output: ` 41 | [ 42 | { 43 | "name": "yellow robot", 44 | "picture": "https://robohash.org/2" 45 | }, 46 | ]`, 47 | }, 48 | { 49 | route: 'GET /photos/2?count=3', 50 | content: 'Starts from the photo at index 2 and returns a total of 3 photos.', 51 | output: ` 52 | [ 53 | { 54 | "name": "yellow robot", 55 | "picture": "https://robohash.org/2" 56 | }, 57 | { 58 | "name": "purple male robot", 59 | "picture": "https://robohash.org/3" 60 | }, 61 | { 62 | "name": "purple female robot", 63 | "picture": "https://robohash.org/4" 64 | }, 65 | ]`, 66 | }, 67 | ], 68 | }, 69 | { 70 | heading: 'Comments', 71 | desc: 'Returns dummy comments.', 72 | routes: [ 73 | { 74 | route: 'GET /comments/', 75 | content: 'Returns all the available dummy comments.', 76 | output: ` 77 | [ 78 | { 79 | "profile": "https://images.unsplash.com/photo-1552207802-77bcb0d13122?ixid=MXwxMjA3fDB8MHxzZWFyY2h8MXx8c2hpcHxlbnwwfHwwfA%3D%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60", 80 | "name": "USER1", 81 | "data": " Lorem Ipsum" 82 | }, 83 | { 84 | "profile": "https://images.unsplash.com/photo-1523536777042-c391e30190ef?ixid=MXwxMjA3fDB8MHx0b3BpYy1mZWVkfDZ8SnBnNktpZGwtSGt8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60", 85 | "name": "USER2", 86 | "data": "dolor sit amet" 87 | }, 88 | { 89 | "profile": "https://images.unsplash.com/photo-1589676383923-3c4e9ec0b94d?ixid=MXwxMjA3fDB8MHx0b3BpYy1mZWVkfDE1fEpwZzZLaWRsLUhrfHxlbnwwfHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60", 90 | "name": "USER3", 91 | "data": "consectetur adipiscing elit" 92 | }, 93 | { 94 | "profile": "https://images.unsplash.com/photo-1540126034813-121bf29033d2?ixid=MXwxMjA3fDB8MHxzZWFyY2h8NHx8cGFuZGF8ZW58MHx8MHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60", 95 | "name": "USER4", 96 | "data": "sed do eiusmod tempor" 97 | }, 98 | { 99 | "profile": "https://images.unsplash.com/photo-1604336755604-96ee6fa9f3f1?ixid=MXwxMjA3fDB8MHxzZWFyY2h8M3x8Z2lyYWZmZXxlbnwwfHwwfA%3D%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60", 100 | "name": "USER5", 101 | "data": "incididunt ut labore et dolore" 102 | }, 103 | { 104 | "profile": "https://images.unsplash.com/photo-1516255648388-71880c3cf449?ixid=MXwxMjA3fDB8MHxzZWFyY2h8MXx8bGVhcGFyZHxlbnwwfHwwfA%3D%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60", 105 | "name": "USER6", 106 | "data": "Ut enim ad minim veniam," 107 | }, 108 | ]`, 109 | }, 110 | ], 111 | }, 112 | { 113 | heading: 'Tasks', 114 | desc: 'Returns to-do activities.', 115 | routes: [ 116 | { 117 | route: 'GET /tasks/2', 118 | content: 'Returns the task at index 2 as specified in taskdata.json.', 119 | output: ` 120 | { 121 | "task_name": "eating", 122 | "completed": false, 123 | "details": "having nice and healthy food" 124 | }`, 125 | }, 126 | { 127 | route: 'GET /tasks/2?count=3', 128 | content: 'Starts from the task at index 2 and returns a total of 3 tasks.', 129 | output: ` 130 | [ 131 | { 132 | "task_name": "eating", 133 | "completed": false, 134 | "details": "having nice and healthy food" 135 | }, 136 | { 137 | "task_name": "sleeping", 138 | "completed": true, 139 | "details": "have a good sleep" 140 | }, 141 | { 142 | "task_name": "writing", 143 | "completed": true, 144 | "details": "write a diary entry or blog posts to have thoughts organized" 145 | } 146 | ]`, 147 | }, 148 | { 149 | route: 'GET /tasks?count=2', 150 | content: 'Returns 2 tasks, starting at index 0 by default.', 151 | output: ` 152 | [ 153 | { 154 | "task_name": "reading", 155 | "completed": true, 156 | "details": "keep up with the world and broaden your horizons" 157 | }, 158 | { 159 | "task_name": "drinking", 160 | "completed": true, 161 | "details": "drink delicious chai or coffee" 162 | } 163 | ]`, 164 | }, 165 | ], 166 | }, 167 | { 168 | heading: 'Users', 169 | desc: 'Returns names, emails and ids', 170 | routes: [ 171 | { 172 | route: 'GET /users/', 173 | content: 'Return all the available dummy user data.', 174 | output: ` 175 | [ 176 | { 177 | "id": "1", 178 | "first_name": "Becky", 179 | "last_name": "Blasbad", 180 | "email": "beck1blas4@gmail.com" 181 | }, 182 | { 183 | "id": "2", 184 | "first_name": "Andry", 185 | "last_name": "Gentry", 186 | "email": "Anrygen002@gmail.com" 187 | }, 188 | { 189 | "id": "3", 190 | "first_name": "David", 191 | "last_name": "Griffin", 192 | "email": "Devdavid9@gmail.com" 193 | } 194 | ]`, 195 | }, 196 | { 197 | route: 'GET /users/1', 198 | content: 'Return dummy user data with the matching Id.', 199 | output: ` 200 | { 201 | "id": "1", 202 | "first_name": "Becky", 203 | "last_name": "Blasbad", 204 | "email": "beck1blas4@gmail.com" 205 | }`, 206 | }, 207 | ], 208 | }, 209 | { 210 | heading: 'Food', 211 | desc: 'Returns photos of food with picture link, name and taste.', 212 | routes: [ 213 | { 214 | route: 'GET /photos/food/', 215 | content: 'Return all the available foodphoto data.', 216 | output: ` 217 | [ 218 | { 219 | "name": "pizza", 220 | "taste": "spicy", 221 | "picture": "https://source.unsplash.com/Oxb84ENcFfU/1600x900" 222 | }, 223 | { 224 | "name": "burger", 225 | "taste": "spicy", 226 | "picture": "https://b.zmtcdn.com/data/homepage_dish_data/4/6e69685d22c94ffd42ccd7e70e246bd9.png" 227 | }, 228 | { 229 | "name": "pasta", 230 | "taste": "spicy", 231 | "picture": "https://b.zmtcdn.com/data/dish_images/bbdabeeb71f0962aff2d87cfc57860061612437785.png" 232 | }, 233 | { 234 | "name": "chicken", 235 | "taste": "spicy", 236 | "picture": "https://b.zmtcdn.com/data/homepage_dish_data/4/742929dcb631403d7c1c1efad2ca2700.png" 237 | }, 238 | ]`, 239 | }, 240 | { 241 | route: 'GET /photos/food/taste', 242 | content: 'Return all the available food taste data.', 243 | output: `[ 244 | { 245 | "taste": ["spicy", "nutty", "sweet"] 246 | } 247 | ]`, 248 | }, 249 | ], 250 | }, 251 | { 252 | heading: 'Songs', 253 | desc: 'Returns song name, singer, genre, links, etc.', 254 | routes: [ 255 | { 256 | route: 'GET /songs/', 257 | content: 'Returns all the available songs', 258 | output: `[ 259 | 260 | { 261 | "name": "Chan Kitta", 262 | "singer": "Ayushmann Khurrana", 263 | "language": "punjabi", 264 | "genre": "romance", 265 | "link": "https://www.youtube.com/watch?v=JFYCc577kjQ" 266 | }, 267 | { 268 | "name": "Afreen Afreem", 269 | "singer": "Rahat Fateh Ali Khan", 270 | "language": "urdu", 271 | "genre": "ghazal", 272 | "link": "https://www.youtube.com/watch?v=kw4tT7SCmaY" 273 | }, 274 | { 275 | "name": "Lut Gaye", 276 | "singer": "Jubin Nautiyal", 277 | "language": "hindi", 278 | "genre": "romance", 279 | "link": "https://www.youtube.com/watch?v=sCbbMZ-q4-I" 280 | }, 281 | { 282 | "name": "Dope Shope", 283 | "singer": "Yo Yo Honey Singh", 284 | "language": "punjabi", 285 | "genre": "pop", 286 | "link": "https://www.youtube.com/watch?v=NrXdauEv9HY" 287 | }, 288 | { 289 | "name": "Tunak Tunak Tun", 290 | "singer": "Daler Mehndi", 291 | "language": "punjabi", 292 | "genre": "indian pop", 293 | "link": "https://www.youtube.com/watch?v=vTIIMJ9tUc8" 294 | }, 295 | ]`, 296 | }, 297 | { 298 | route: 'GET /songs/5', 299 | content: 'Returns song data from perticular index.', 300 | output: ` 301 | { 302 | "name": "Bohemian Rhapsody", 303 | "singer": "Queen", 304 | "language": "english", 305 | "genre": "classic rock", 306 | "link": "https://www.youtube.com/watch?v=fJ9rUzIMcZQ" 307 | }`, 308 | }, 309 | { 310 | route: 'GET /songs?artist=Ayushmann+Khurrana', 311 | content: 'Returns song data from perticular artist.', 312 | output: `[ 313 | { 314 | "name": "Chan Kitta", 315 | "singer": "Ayushmann Khurrana", 316 | "language": "punjabi", 317 | "genre": "romance", 318 | "link": "https://www.youtube.com/watch?v=JFYCc577kjQ" 319 | } 320 | 321 | ]`, 322 | }, 323 | { 324 | route: 'GET /songs?genre=pop', 325 | content: 'Returns song data from perticular genre.', 326 | output: `[ 327 | 328 | { 329 | "name": "Dope Shope", 330 | "singer": "Yo Yo Honey Singh", 331 | "language": "punjabi", 332 | "genre": "pop", 333 | "link": "https://www.youtube.com/watch?v=NrXdauEv9HY" 334 | }, 335 | { 336 | "name": "Oonchi Hai Building", 337 | "singer": "Anu Malik", 338 | "language": "hindi", 339 | "genre": "pop", 340 | "link": "https://www.youtube.com/watch?v=QmHTmr8Kazs" 341 | }, 342 | { 343 | "name": "Brown Munde", 344 | "singer": "AP DHILLON", 345 | "language": "punjabi", 346 | "genre": "pop", 347 | "link": "https://www.youtube.com/watch?v=VNs_cCtdbPc" 348 | } 349 | 350 | ]`, 351 | }, 352 | { 353 | route: 'GET /songs?language=punjabi', 354 | content: 'Returns song data from perticular language.', 355 | output: `[ 356 | { 357 | "name": "Chan Kitta", 358 | "singer": "Ayushmann Khurrana", 359 | "language": "punjabi", 360 | "genre": "romance", 361 | "link": "https://www.youtube.com/watch?v=JFYCc577kjQ" 362 | }, 363 | { 364 | "name": "Dope Shope", 365 | "singer": "Yo Yo Honey Singh", 366 | "language": "punjabi", 367 | "genre": "pop", 368 | "link": "https://www.youtube.com/watch?v=NrXdauEv9HY" 369 | }, 370 | { 371 | "name": "Tunak Tunak Tun", 372 | "singer": "Daler Mehndi", 373 | "language": "punjabi", 374 | "genre": "indian pop", 375 | "link": "https://www.youtube.com/watch?v=vTIIMJ9tUc8" 376 | }, 377 | { 378 | "name": "Brown Munde", 379 | "singer": "AP DHILLON", 380 | "language": "punjabi", 381 | "genre": "pop", 382 | "link": "https://www.youtube.com/watch?v=VNs_cCtdbPc" 383 | } 384 | 385 | ]`, 386 | }, 387 | { 388 | route: 'GET /songs?genre=pop&language=punjabi', 389 | content: 'Return dummy songs data after chaining genre and language query parameter.', 390 | output: `[ 391 | 392 | { 393 | "name": "Dope Shope", 394 | "singer": "Yo Yo Honey Singh", 395 | "language": "punjabi", 396 | "genre": "pop", 397 | "link": "https://www.youtube.com/watch?v=NrXdauEv9HY" 398 | }, 399 | { 400 | "name": "Brown Munde", 401 | "singer": "AP DHILLON", 402 | "language": "punjabi", 403 | "genre": "pop", 404 | "link": "https://www.youtube.com/watch?v=VNs_cCtdbPc" 405 | } 406 | 407 | ]`, 408 | }, 409 | { 410 | route: 'GET /songs?artist=A.R.+Rahman&genre=sufi&language=urdu', 411 | content: 'Return dummy songs data after chaining multiple song query parameter.', 412 | output: `[ 413 | { 414 | "name": "Kun Faya Kun", 415 | "singer": "A.R. Rahman", 416 | "language": "urdu", 417 | "genre": "sufi", 418 | "link": "https://www.youtube.com/watch?v=T94PHkuydcw" 419 | } 420 | 421 | ]`, 422 | }, 423 | ], 424 | }, 425 | { 426 | heading: 'Shows', 427 | desc: 'Returns TV show name, rating, description, etc.', 428 | routes: [ 429 | { 430 | route: 'GET /shows/', 431 | content: 'Return all the available shows with title,genre,season,episodes,rating,description.', 432 | output: ` 433 | [ 434 | { 435 | "title": "Friends", 436 | "genre": ["comedy", "romance"], 437 | "rating": "8.9", 438 | "season": "10", 439 | "episodes": "236", 440 | "description": "Ross Geller, Rachel Green, Monica Geller, Joey Tribbiani, Chandler Bing, and Phoebe Buffay are six 20 something year olds living in New York City. Over the course of 10 years and seasons, these friends go through family,love,drama,friendship and comedy." 441 | }, 442 | { 443 | "title": "Money Heist", 444 | "genre": ["drama", "thriller"], 445 | "rating": "8.3", 446 | "season": "2", 447 | "episodes": "31", 448 | "description": "Eight thieves take hostages and lock themselves in the Royal Mint of Spain as a criminal mastermind manipulates the police to carry out his plan." 449 | }, 450 | { 451 | "title": "Sherlock Homles", 452 | "genre": ["detective", "fiction"], 453 | "rating": "9.1", 454 | "season": "4", 455 | "episodes": "13", 456 | "description": "A modern update finds the famous sleuth and his doctor partner solving crime in 21st century London." 457 | }, 458 | { 459 | "title": "The Big Bang Theory", 460 | "genre": ["sitcom", "drama"], 461 | "rating": "8.1", 462 | "season": "12", 463 | "episodes": "279", 464 | "description": "A woman who moves into an apartment across the hall from two brilliant but socially awkward physicists shows them how little they know about life outside of the laboratory." 465 | }, 466 | { 467 | "title": "Little Things", 468 | "genre": ["comedy", "drama"], 469 | "rating": "8.3", 470 | "season": "3", 471 | "episodes": "21", 472 | "description": "A cohabiting couple in their 20s navigate the ups and downs of work, modern-day relationships and finding themselves in contemporary Bengaluru." 473 | }, 474 | ]`, 475 | }, 476 | { 477 | route: 'GET /shows/2', 478 | content: 'Return show data at index 2 from showsdata.json.', 479 | output: ` 480 | { 481 | "title": "Little Things", 482 | "genre": ["comedy", "drama"], 483 | "rating": "8.3", 484 | "season": "3", 485 | "episodes": "21", 486 | "description": "A cohabiting couple in their 20s navigate the ups and downs of work, modern-day relationships and finding themselves in contemporary Bengaluru." 487 | }, 488 | }`, 489 | }, 490 | { 491 | route: 'GET /shows?genre=drama', 492 | content: 'Return show data specific to a perticular genre from showsdata.json.', 493 | output: ` 494 | [ 495 | { 496 | "title": "Money Heist", 497 | "genre": [ 498 | "drama", 499 | "thriller" 500 | ], 501 | "rating": "8.3", 502 | "season": "2", 503 | "episodes": "31", 504 | "description": "Eight thieves take hostages and lock themselves in the Royal Mint of Spain as a criminal mastermind manipulates the police to carry out his plan." 505 | }, 506 | { 507 | "title": "The Big Bang Theory", 508 | "genre": [ 509 | "sitcom", 510 | "drama" 511 | ], 512 | "rating": "8.1", 513 | "season": "12", 514 | "episodes": "279", 515 | "description": "A woman who moves into an apartment across the hall from two brilliant but socially awkward physicists shows them how little they know about life outside of the laboratory." 516 | }, 517 | { 518 | "title": "Little Things", 519 | "genre": [ 520 | "comedy", 521 | "drama" 522 | ], 523 | "rating": "8.3", 524 | "season": "3", 525 | "episodes": "21", 526 | "description": "A cohabiting couple in their 20s navigate the ups and downs of work, modern-day relationships and finding themselves in contemporary Bengaluru." 527 | }, 528 | ]`, 529 | }, 530 | { 531 | route: 'GET /shows?rating=8.9', 532 | content: 'Return show data with specific rating from showsdata.json.', 533 | output: ` 534 | [ 535 | { 536 | "title": "Friends", 537 | "genre": [ 538 | "comedy", 539 | "romance" 540 | ], 541 | "rating": "8.9", 542 | "season": "10", 543 | "episodes": "236", 544 | "description": "Ross Geller, Rachel Green, Monica Geller, Joey Tribbiani, Chandler Bing, and Phoebe Buffay are six 20 something year olds living in New York City. Over the course of 10 years and seasons, these friends go through family,love,drama,friendship and comedy." 545 | }, 546 | { 547 | "title": "The Office", 548 | "genre": [ 549 | "comedy", 550 | "drama", 551 | "romance" 552 | ], 553 | "rating": "8.9", 554 | "season": "9", 555 | "episodes": "201", 556 | "description": "A mockumentary on a group of typical office workers, where the workday consists of ego clashes, inappropriate behavior, and tedium." 557 | } 558 | 559 | ]`, 560 | }, 561 | { 562 | route: 'GET /shows?season=10', 563 | content: 'Return show data based on season count from showsdata.json.', 564 | output: ` 565 | [ 566 | { 567 | "title": "Friends", 568 | "genre": [ 569 | "comedy", 570 | "romance" 571 | ], 572 | "rating": "8.9", 573 | "season": "10", 574 | "episodes": "236", 575 | "description": "Ross Geller, Rachel Green, Monica Geller, Joey Tribbiani, Chandler Bing, and Phoebe Buffay are six 20 something year olds living in New York City. Over the course of 10 years and seasons, these friends go through family,love,drama,friendship and comedy." 576 | } 577 | ]`, 578 | }, 579 | { 580 | route: 'GET /shows?rating=9.8&genre=comedy', 581 | content: 'Return show data based on rating and season count from showsdata.json.', 582 | output: ` 583 | [ 584 | { 585 | "title": "Friends", 586 | "genre": [ 587 | "comedy", 588 | "romance" 589 | ], 590 | "rating": "8.9", 591 | "season": "10", 592 | "episodes": "236", 593 | "description": "Ross Geller, Rachel Green, Monica Geller, Joey Tribbiani, Chandler Bing, and Phoebe Buffay are six 20 something year olds living in New York City. Over the course of 10 years and seasons, these friends go through family,love,drama,friendship and comedy." 594 | }, 595 | ]`, 596 | }, 597 | { 598 | route: 'GET /shows?genre=comedy&season=10&rating=8.9', 599 | content: 'Return show data after chaining multiple show query parameter.', 600 | output: ` 601 | [ 602 | { 603 | "title": "Friends", 604 | "genre": [ 605 | "comedy", 606 | "romance" 607 | ], 608 | "rating": "8.9", 609 | "season": "10", 610 | "episodes": "236", 611 | "description": "Ross Geller, Rachel Green, Monica Geller, Joey Tribbiani, Chandler Bing, and Phoebe Buffay are six 20 something year olds living in New York City. Over the course of 10 years and seasons, these friends go through family,love,drama,friendship and comedy." 612 | } 613 | ]`, 614 | }, 615 | ], 616 | }, 617 | { 618 | heading: 'Books', 619 | desc: 'Returns book title, author, price, rating, etc.', 620 | routes: [ 621 | { 622 | route: 'GET /books/', 623 | content: 'Return all the available book data.', 624 | output: ` 625 | [ 626 | { 627 | "title": "The Story Of My Experiments With The Truth", 628 | "author": "Mohandas Karamchand Gandhi", 629 | "rating": "4.5", 630 | "descritpion": "Mohandas Karamchand Gandhi has always been a very prominent figure in Indian history. From his unbeatable spirit to inspiring courage, from various controversies to his life as the father of the nation, Gandhi has always been an interesting, inspiring and impressive personality to read about.", 631 | "price": "₹159" 632 | }, 633 | { 634 | "title": "The Guide", 635 | "author": "R.K. Narayan", 636 | "rating": "4.5", 637 | "descritpion": "R.K Narayan is best known for stories based in and around the fictional village of Malgudi. The Guide is yet another story set up in Malgudi. R.K. Narayan won the Sahitya Akademi Award for the book in 1960. The Guide is the story of a tour guide who transforms himself into a spiritual Guru and then the greatest holy man of India. The book was also adapted as a film which starred the legendary actor Dev Anand.", 638 | "price": "₹156" 639 | }, 640 | { 641 | "title": "A Fine Balance", 642 | "author": "Rohinton Mistry", 643 | "rating": "4.4", 644 | "descritpion": "A fine balance revolves around various characters in Mumbai (then Bombay) during the time of turmoil and government emergencies. The story of friendship and love that progresses among the characters of the book will keep you hooked till the end.", 645 | "price": "₹1,075" 646 | }, 647 | { 648 | "title": "Midnight’s Children", 649 | "author": "Salman Rushdie", 650 | "rating": "4.3", 651 | "descritpion": "Midnight’s Children portrays the journey of India from British rule to independence and then partition. The book received a great response, winning the Booker Prize in 1981 and the “Booker of Bookers” Prize (commemorating the best among all the Booker winners) twice – in 1993 and 2008! The book travels to various parts of the country including Kashmir, Agra and Mumbai and incorporates many actual historic events.", 652 | "price": "₹300" 653 | } 654 | ]`, 655 | }, 656 | { 657 | route: 'GET /books/2', 658 | content: 'Return book data at index 2 from booksdata.json.', 659 | output: ` 660 | { 661 | "title": "Midnight’s Children", 662 | "author": "Salman Rushdie", 663 | "rating": "4.3", 664 | "descritpion": "Midnight’s Children portrays the journey of India from British rule to independence and then partition. The book received a great response, winning the Booker Prize in 1981 and the “Booker of Bookers” Prize (commemorating the best among all the Booker winners) twice – in 1993 and 2008! The book travels to various parts of the country including Kashmir, Agra and Mumbai and incorporates many actual historic events.", 665 | "price": "₹300" 666 | }`, 667 | }, 668 | { 669 | route: 'GET /books?author=Vikram+Seth', 670 | content: 'Return book data with specific author name from booksdata.json.', 671 | output: ` 672 | [ 673 | { 674 | "title": "A Suitable Boy", 675 | "author": "Vikram Seth", 676 | "rating": "4.0", 677 | "descritpion": "Published in 1993, this 1349-pages-long-book is one of the longest novels ever published in a single volume in the English Language. The story focuses on India post-partition as a family looks for a suitable boy to marry their daughter.", 678 | "price": "₹947" 679 | } 680 | ]`, 681 | }, 682 | { 683 | route: 'GET /books?price=₹268', 684 | content: 'Return book data with specific author name from booksdata.json.', 685 | output: ` 686 | [ 687 | { 688 | "title": "The Interpreter Of Maladies", 689 | "author": "Jhumpa Lahiri", 690 | "rating": "4.5", 691 | "descritpion": "This is a collection of nine stories by Lahiri. The stories are based on lives of Indians and Indian Americans who are lost between the two cultures. The book was published in 1999 and won the Pulitzer Prize for Fiction and the Hemingway Foundation/PEN Award in the year 2000 and has sold over 15 million copies worldwide.", 692 | "price": "₹268" 693 | } 694 | ]`, 695 | }, 696 | { 697 | route: 'GET /books?title=The+Glass+Palace', 698 | content: 'Return book data with specific title from booksdata.json.', 699 | output: ` 700 | [ 701 | { 702 | "title": "The Glass Palace", 703 | "author": "Amitav Ghosh", 704 | "rating": "4.5", 705 | "descritpion": "This book won Grand Prize for Fiction at the Frankfurt International e-Book Awards in 2001. The story is set in Burma and focuses on various issues during the British invasion in 1885. The novel beautifully portrays the circumstances and incidents that made Burma, India and Malaya what they are today. This story of the empire, love and the changing society is definitely worth reading.", 706 | "price": "₹248" 707 | } 708 | ]`, 709 | }, 710 | { 711 | route: 'GET /books?author=Vikram+Seth&price=₹947', 712 | content: 'Return book data with specific title from booksdata.json.', 713 | output: ` 714 | [ 715 | { 716 | "title": "A Suitable Boy", 717 | "author": "Vikram Seth", 718 | "rating": "4.0", 719 | "descritpion": "Published in 1993, this 1349-pages-long-book is one of the longest novels ever published in a single volume in the English Language. The story focuses on India post-partition as a family looks for a suitable boy to marry their daughter.", 720 | "price": "₹947" 721 | } 722 | ]`, 723 | }, 724 | { 725 | route: 'GET /books?title=God+of+Small+Things&author=Arundhati+Roy&price=₹275', 726 | content: 'Return book data after chaining multiple book query parameter.', 727 | output: ` 728 | [ 729 | { 730 | "title": "God of Small Things", 731 | "author": "Arundhati Roy", 732 | "rating": "4.1", 733 | "descritpion": "The debut novel by Roy, which took almost four years to finish is a story of fraternal twins and how small things make a large difference in people’s lives and behavior. The book was awarded the Booker Prize in 1997 and is Roy’s only published novel so far. The story narrated in third person is set in Kerala, and takes place in 1969.", 734 | "price": "₹275" 735 | } 736 | ]`, 737 | }, 738 | ], 739 | }, 740 | ] 741 | export default data 742 | -------------------------------------------------------------------------------- /src/views/index.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | JSON Hub 20 | 21 | 22 | 23 |
24 |
25 |

26 |
27 | A community-owned REST API service for developers. 28 |

29 | Free fake data for your testing and development needs 30 |
31 |

32 | 33 |

34 |
35 |
36 |
37 |

Supported Endpoints

38 | <% for(let outer=0; outer 39 | 40 |
41 |

<%= data[outer].heading %>

42 | 43 |

44 | <%= data[outer].desc %> 45 |

46 |
> 47 | <% data[outer].routes.forEach(function(routeinfo){ %> 48 |
49 | 50 |
51 |

52 | 53 | <%= routeinfo.route %> 54 |

55 |

56 | <%= routeinfo.content %> 57 |

58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
<%=routeinfo.output%>
69 |
70 |
71 |
72 | 73 | 74 |
75 |
76 | <% }) %> 77 |
78 | 79 |
80 | <% const btnid = "btn"+outer%> 81 | 82 | <% } %> 83 | 84 |
85 |
86 |

Made with 💖 by a Homo Sapien

87 |
88 | 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Visit https://aka.ms/tsconfig.json to read more about this file */ 4 | 5 | /* Basic Options */ 6 | // "incremental": true, /* Enable incremental compilation */ 7 | "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */ 8 | "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ 9 | // "lib": [], /* Specify library files to be included in the compilation. */ 10 | // "allowJs": true, /* Allow javascript files to be compiled. */ 11 | // "checkJs": true, /* Report errors in .js files. */ 12 | // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ 13 | // "declaration": true, /* Generates corresponding '.d.ts' file. */ 14 | // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ 15 | // "sourceMap": true, /* Generates corresponding '.map' file. */ 16 | // "outFile": "./", /* Concatenate and emit output to single file. */ 17 | "outDir": "./dist", /* Redirect output structure to the directory. */ 18 | "rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ 19 | // "composite": true, /* Enable project compilation */ 20 | // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ 21 | // "removeComments": true, /* Do not emit comments to output. */ 22 | // "noEmit": true, /* Do not emit outputs. */ 23 | // "importHelpers": true, /* Import emit helpers from 'tslib'. */ 24 | // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ 25 | // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ 26 | 27 | /* Strict Type-Checking Options */ 28 | "strict": true, /* Enable all strict type-checking options. */ 29 | // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ 30 | // "strictNullChecks": true, /* Enable strict null checks. */ 31 | // "strictFunctionTypes": true, /* Enable strict checking of function types. */ 32 | // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ 33 | // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ 34 | // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ 35 | // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ 36 | 37 | /* Additional Checks */ 38 | // "noUnusedLocals": true, /* Report errors on unused locals. */ 39 | // "noUnusedParameters": true, /* Report errors on unused parameters. */ 40 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ 41 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ 42 | 43 | /* Module Resolution Options */ 44 | "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ 45 | // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ 46 | // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ 47 | // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ 48 | // "typeRoots": [], /* List of folders to include type definitions from. */ 49 | // "types": [], /* Type declaration files to be included in compilation. */ 50 | // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ 51 | "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ 52 | // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ 53 | // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ 54 | 55 | /* Source Map Options */ 56 | // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ 57 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 58 | // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ 59 | // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ 60 | 61 | /* Experimental Options */ 62 | // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ 63 | // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ 64 | 65 | /* Advanced Options */ 66 | "skipLibCheck": true, /* Skip type checking of declaration files. */ 67 | "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ 68 | } 69 | } 70 | --------------------------------------------------------------------------------