├── .github
└── FUNDING.yml
├── .gitignore
├── .nvmrc
├── .travis.yml
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── PULL_REQUEST_TEMPLATE.md
├── README.md
├── config
├── env.js
├── jest
│ ├── cssTransform.js
│ └── fileTransform.js
├── paths.js
├── webpack.config.dev.js
├── webpack.config.prod.js
└── webpackDevServer.config.js
├── package-lock.json
├── package.json
├── public
├── favicon.ico
├── index.html
└── manifest.json
├── scripts
├── build.js
├── start.js
└── test.js
└── src
├── App.test.js
├── actions
├── actionTypes.js
└── httpInfoAction.js
├── apis
├── data
│ ├── codes
│ │ ├── 1xx.json
│ │ ├── 2xx.json
│ │ ├── 3xx.json
│ │ ├── 4xx.json
│ │ ├── 5xx.json
│ │ └── index.js
│ ├── index.js
│ ├── questions
│ │ ├── codes
│ │ │ ├── 1xx.json
│ │ │ ├── 2xx.json
│ │ │ ├── 3xx.json
│ │ │ ├── 4xx.json
│ │ │ ├── 5xx.json
│ │ │ └── index.js
│ │ └── httpSeriesCodeQuestions.json
│ ├── series.json
│ ├── sites.json
│ └── stability.json
└── httpInfoApi.js
├── components
├── common
│ ├── contentHeader.js
│ └── pageHeader.js
├── flow
│ ├── httpCodeCardList.js
│ ├── httpCodeInfoCard.js
│ ├── httpSeriesCardList.js
│ ├── httpSeriesCardMinimal.js
│ └── questionComponent.js
├── layouts
│ └── defaultLayout.js
└── motion
│ └── ScrollReveal
│ ├── ScrollReveal.js
│ └── index.js
├── constant
├── params.js
└── routes.js
├── containers
├── FAQ.json
├── FAQContainer.js
├── analytics
│ └── gaTrackingContainer.js
├── appContainer.js
├── creditsContainer.js
├── httpQuestionaire
│ ├── httpStatusAnswerContainer.js
│ ├── httpStatusCodeAnswerContainer.js
│ └── httpStatusSeriesAnswerContainer.js
├── httpcodesListContainer.js
└── resourceContainer.js
├── index.js
├── reducers
├── httpInfoReducer.js
└── index.js
├── serviceWorker.js
├── static
├── css
│ └── App.css
└── img
│ └── logo.svg
└── store
└── configureStore.js
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: [anubhavsrivastava]
4 | patreon: theanubhav
5 | open_collective: onlyanubhav
6 | ko_fi: theanubhav
7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9 | liberapay: # Replace with a single Liberapay username
10 | issuehunt: # Replace with a single IssueHunt username
11 | otechie: # Replace with a single Otechie username
12 | custom: ['https://donorbox.org/theanubhav', 'https://www.buymeacoffee.com/theanubhav','https://paypal.me/onlyanubhav', 'https://theanubhav.com/sponsor']
13 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 |
8 | # Runtime data
9 | pids
10 | *.pid
11 | *.seed
12 | *.pid.lock
13 |
14 | # Directory for instrumented libs generated by jscoverage/JSCover
15 | lib-cov
16 |
17 | # Coverage directory used by tools like istanbul
18 | coverage
19 |
20 | # nyc test coverage
21 | .nyc_output
22 |
23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24 | .grunt
25 |
26 | # Bower dependency directory (https://bower.io/)
27 | bower_components
28 |
29 | # node-waf configuration
30 | .lock-wscript
31 |
32 | # Compiled binary addons (https://nodejs.org/api/addons.html)
33 | build/Release
34 |
35 | # Dependency directories
36 | node_modules/
37 | jspm_packages/
38 |
39 | # TypeScript v1 declaration files
40 | typings/
41 |
42 | # Optional npm cache directory
43 | .npm
44 |
45 | # Optional eslint cache
46 | .eslintcache
47 |
48 | # Optional REPL history
49 | .node_repl_history
50 |
51 | # Output of 'npm pack'
52 | *.tgz
53 |
54 | # Yarn Integrity file
55 | .yarn-integrity
56 |
57 | # dotenv environment variables file
58 | .env
59 |
60 | # next.js build output
61 | .next
62 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
63 |
64 | # dependencies
65 | /node_modules
66 | /.pnp
67 | .pnp.js
68 |
69 | # testing
70 | /coverage
71 |
72 | # production
73 | /build
74 |
75 | # misc
76 | .DS_Store
77 | .env.local
78 | .env.development.local
79 | .env.test.local
80 | .env.production.local
81 |
82 | npm-debug.log*
83 | yarn-debug.log*
84 | yarn-error.log*
85 |
--------------------------------------------------------------------------------
/.nvmrc:
--------------------------------------------------------------------------------
1 | v9.10.1
2 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - '11.10.1'
4 | cache:
5 | directories:
6 | - node_modules
7 | before_install:
8 | - npm update
9 | install:
10 | - npm install
11 | script:
12 | - npm run coveralls
13 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as
6 | contributors and maintainers pledge to making participation in our project and
7 | our community a harassment-free experience for everyone, regardless of age, body
8 | size, disability, ethnicity, sex characteristics, gender identity and expression,
9 | level of experience, education, socio-economic status, nationality, personal
10 | appearance, race, religion, or sexual identity and orientation.
11 |
12 | ## Our Standards
13 |
14 | Examples of behavior that contributes to creating a positive environment
15 | include:
16 |
17 | * Using welcoming and inclusive language
18 | * Being respectful of differing viewpoints and experiences
19 | * Gracefully accepting constructive criticism
20 | * Focusing on what is best for the community
21 | * Showing empathy towards other community members
22 |
23 | Examples of unacceptable behavior by participants include:
24 |
25 | * The use of sexualized language or imagery and unwelcome sexual attention or
26 | advances
27 | * Trolling, insulting/derogatory comments, and personal or political attacks
28 | * Public or private harassment
29 | * Publishing others' private information, such as a physical or electronic
30 | address, without explicit permission
31 | * Other conduct which could reasonably be considered inappropriate in a
32 | professional setting
33 |
34 | ## Our Responsibilities
35 |
36 | Project maintainers are responsible for clarifying the standards of acceptable
37 | behavior and are expected to take appropriate and fair corrective action in
38 | response to any instances of unacceptable behavior.
39 |
40 | Project maintainers have the right and responsibility to remove, edit, or
41 | reject comments, commits, code, wiki edits, issues, and other contributions
42 | that are not aligned to this Code of Conduct, or to ban temporarily or
43 | permanently any contributor for other behaviors that they deem inappropriate,
44 | threatening, offensive, or harmful.
45 |
46 | ## Scope
47 |
48 | This Code of Conduct applies both within project spaces and in public spaces
49 | when an individual is representing the project or its community. Examples of
50 | representing a project or community include using an official project e-mail
51 | address, posting via an official social media account, or acting as an appointed
52 | representative at an online or offline event. Representation of a project may be
53 | further defined and clarified by project maintainers.
54 |
55 | ## Enforcement
56 |
57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
58 | reported by contacting the project team at anubhav.srivastava00@gmail.com. All
59 | complaints will be reviewed and investigated and will result in a response that
60 | is deemed necessary and appropriate to the circumstances. The project team is
61 | obligated to maintain confidentiality with regard to the reporter of an incident.
62 | Further details of specific enforcement policies may be posted separately.
63 |
64 | Project maintainers who do not follow or enforce the Code of Conduct in good
65 | faith may face temporary or permanent repercussions as determined by other
66 | members of the project's leadership.
67 |
68 | ## Attribution
69 |
70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72 |
73 | [homepage]: https://www.contributor-covenant.org
74 |
75 | For answers to common questions about this code of conduct, see
76 | https://www.contributor-covenant.org/faq
77 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contribution Guidelines
2 |
3 | Please ensure your pull request follow these guidelines:
4 |
5 | - Search previous suggestions before making a new one, as yours may be a duplicate.
6 | - Make an individual pull request for each suggestion. Another way to suggest it opening an issue on this repository.
7 | - Keep descriptions short and simple, but descriptive.
8 | - Check your spelling and grammar.
9 | - Make sure your text editor is set to remove trailing whitespace and not change any other part of except for place you desire.
10 |
11 | Thank you for your contributions/suggestions!
12 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Anubhav Srivastava
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Whats my HTTP Status Code - [Visit](https://httpstatuscode.netlify.com)
2 |
3 | A UI Based interface to guide you to exact web api - http specification status your server should return for any web request.
4 |
5 | [](https://travis-ci.org/anubhavsrivastava/whats-my-http-statuscode)
6 | [](https://coveralls.io/github/anubhavsrivastava/whats-my-http-statuscode?branch=master)
7 | [](http://makeapullrequest.com)
8 | [](https://github.com/anubhavsrivastava/whats-my-http-statuscode/issues)
9 | [](http://hits.dwyl.io/anubhavsrivastava/whats-my-http-statuscode)
10 |
11 | ## Introduction
12 |
13 | This projects helps you choose appropriate HTTP status code for your web APIs. Based on series of questions, it lets arrive to a appropriate HTTP status code (with reason). In short, it makes choosing HTTP code much easier.
14 |
15 | ## Concepts
16 |
17 | ### Usage
18 |
19 | Answer a series of question regarding your current implementation or problem that you have with the API, starting off with selection of HTTP code series, like 200 series (success) or 500 series (server error). Once you have correctly identified you HTTP status series, you can answer few more questions to get to exact HTTP status code.
20 |
21 | #### Why should any developer use it?
22 |
23 | There can be a confusion regarding what exact HTTP status code should be for a particular scenario, for eg, should it be `404 Not Found` or `204 No Content` in scenarios where resource exist but has no information. Or should one give `403 Forbidden` for access denied resource and let the user know about existence of the resource (security) or should say `404 Not Found`.
24 |
25 | #### For whom is this tool meant for?
26 |
27 | This is meant for Restful APIs and system that want to follow standard HTTP status code. One should consider following a specification for better usability across system, providing APIs to third party, disconnecting WEB API server with frontend to understand API response, or simply move ahead with just `200 OK` status across the system with actual reason in body `{ "status": "failure" }`
28 |
29 | ## Inspiration
30 |
31 | Inspired by the awesome work on HTTP status code selection by [Michael Kropat - Codetinkerer.com](https://www.codetinkerer.com/2015/12/04/choosing-an-http-status-code.html)
32 |
33 | ## Development
34 |
35 | To add more features or fix a thing or two, to this project, you need to make sure you have all the requirements checked, this project installed, and a little understanding of this project.
36 |
37 | ### Requirement
38 |
39 | You need to be at least familiar with the following tools and languages:
40 |
41 | - HTML/CSS 3/JavaScript
42 | - React/Redux/React-Router
43 | - JSON
44 |
45 | ### Installation
46 |
47 | You can now install the project and start developing. To do so, just follow these steps:
48 |
49 | - Fork this project.
50 | - Clone your fork git clone
51 | - Branch out git branch -b NEW-BRANCH
52 | - Make your changes.
53 | - Create a pull request.
54 |
55 | To run this project locally, perform following steps
56 |
57 | - Install packages via `npm install` or `yarn` , this will install all the dependencies required by the project
58 | - To start development on local machine, run `npm start` on terminal.
59 |
60 | P.S This project is created from ejected `create-react-app`.
61 |
62 | ## Contribution
63 |
64 | One can contribute to this project in following ways,
65 |
66 | ### Development
67 |
68 | This project can be improved so much more, with new features and design. Code refactoring is also welcomed. If you are willing and interested, feel free to help develop it for yourself and others.
69 |
70 | ### Report issues and help improve
71 |
72 | If you feel a feature is missing, or you have encounter a bug, report it in the issues section. Even if you feel question/flow are leading to wrong interpretation, feel free to open a issue.
73 | Please read the [contribution guidelines](CONTRIBUTING.md) to get started.
74 |
75 | ### Spread the words
76 |
77 | ⭐️ Star this project, use it, or share it with your friends. It will really help us to gain motivation and zeal towards working on it.
78 |
79 | ## License
80 |
81 | [](LICENSE)
82 |
83 | Refer [LICENSE](LICENSE) file in this repository.
84 |
--------------------------------------------------------------------------------
/config/env.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const fs = require('fs');
4 | const path = require('path');
5 | const paths = require('./paths');
6 |
7 | // Make sure that including paths.js after env.js will read .env variables.
8 | delete require.cache[require.resolve('./paths')];
9 |
10 | const NODE_ENV = process.env.NODE_ENV;
11 | if (!NODE_ENV) {
12 | throw new Error(
13 | 'The NODE_ENV environment variable is required but was not specified.'
14 | );
15 | }
16 |
17 | // https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use
18 | var dotenvFiles = [
19 | `${paths.dotenv}.${NODE_ENV}.local`,
20 | `${paths.dotenv}.${NODE_ENV}`,
21 | // Don't include `.env.local` for `test` environment
22 | // since normally you expect tests to produce the same
23 | // results for everyone
24 | NODE_ENV !== 'test' && `${paths.dotenv}.local`,
25 | paths.dotenv,
26 | ].filter(Boolean);
27 |
28 | // Load environment variables from .env* files. Suppress warnings using silent
29 | // if this file is missing. dotenv will never modify any environment variables
30 | // that have already been set. Variable expansion is supported in .env files.
31 | // https://github.com/motdotla/dotenv
32 | // https://github.com/motdotla/dotenv-expand
33 | dotenvFiles.forEach(dotenvFile => {
34 | if (fs.existsSync(dotenvFile)) {
35 | require('dotenv-expand')(
36 | require('dotenv').config({
37 | path: dotenvFile,
38 | })
39 | );
40 | }
41 | });
42 |
43 | // We support resolving modules according to `NODE_PATH`.
44 | // This lets you use absolute paths in imports inside large monorepos:
45 | // https://github.com/facebook/create-react-app/issues/253.
46 | // It works similar to `NODE_PATH` in Node itself:
47 | // https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders
48 | // Note that unlike in Node, only *relative* paths from `NODE_PATH` are honored.
49 | // Otherwise, we risk importing Node.js core modules into an app instead of Webpack shims.
50 | // https://github.com/facebook/create-react-app/issues/1023#issuecomment-265344421
51 | // We also resolve them to make sure all tools using them work consistently.
52 | const appDirectory = fs.realpathSync(process.cwd());
53 | process.env.NODE_PATH = (process.env.NODE_PATH || '')
54 | .split(path.delimiter)
55 | .filter(folder => folder && !path.isAbsolute(folder))
56 | .map(folder => path.resolve(appDirectory, folder))
57 | .join(path.delimiter);
58 |
59 | // Grab NODE_ENV and REACT_APP_* environment variables and prepare them to be
60 | // injected into the application via DefinePlugin in Webpack configuration.
61 | const REACT_APP = /^REACT_APP_/i;
62 |
63 | function getClientEnvironment(publicUrl) {
64 | const raw = Object.keys(process.env)
65 | .filter(key => REACT_APP.test(key))
66 | .reduce(
67 | (env, key) => {
68 | env[key] = process.env[key];
69 | return env;
70 | },
71 | {
72 | // Useful for determining whether we’re running in production mode.
73 | // Most importantly, it switches React into the correct mode.
74 | NODE_ENV: process.env.NODE_ENV || 'development',
75 | // Useful for resolving the correct path to static assets in `public`.
76 | // For example, .
77 | // This should only be used as an escape hatch. Normally you would put
78 | // images into the `src` and `import` them in code to get their paths.
79 | PUBLIC_URL: publicUrl,
80 | }
81 | );
82 | // Stringify all values so we can feed into Webpack DefinePlugin
83 | const stringified = {
84 | 'process.env': Object.keys(raw).reduce((env, key) => {
85 | env[key] = JSON.stringify(raw[key]);
86 | return env;
87 | }, {}),
88 | };
89 |
90 | return { raw, stringified };
91 | }
92 |
93 | module.exports = getClientEnvironment;
94 |
--------------------------------------------------------------------------------
/config/jest/cssTransform.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | // This is a custom Jest transformer turning style imports into empty objects.
4 | // http://facebook.github.io/jest/docs/en/webpack.html
5 |
6 | module.exports = {
7 | process() {
8 | return 'module.exports = {};';
9 | },
10 | getCacheKey() {
11 | // The output is always the same.
12 | return 'cssTransform';
13 | },
14 | };
15 |
--------------------------------------------------------------------------------
/config/jest/fileTransform.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const path = require('path');
4 |
5 | // This is a custom Jest transformer turning file imports into filenames.
6 | // http://facebook.github.io/jest/docs/en/webpack.html
7 |
8 | module.exports = {
9 | process(src, filename) {
10 | const assetFilename = JSON.stringify(path.basename(filename));
11 |
12 | if (filename.match(/\.svg$/)) {
13 | return `module.exports = {
14 | __esModule: true,
15 | default: ${assetFilename},
16 | ReactComponent: (props) => ({
17 | $$typeof: Symbol.for('react.element'),
18 | type: 'svg',
19 | ref: null,
20 | key: null,
21 | props: Object.assign({}, props, {
22 | children: ${assetFilename}
23 | })
24 | }),
25 | };`;
26 | }
27 |
28 | return `module.exports = ${assetFilename};`;
29 | },
30 | };
31 |
--------------------------------------------------------------------------------
/config/paths.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const path = require('path');
4 | const fs = require('fs');
5 | const url = require('url');
6 |
7 | // Make sure any symlinks in the project folder are resolved:
8 | // https://github.com/facebook/create-react-app/issues/637
9 | const appDirectory = fs.realpathSync(process.cwd());
10 | const resolveApp = relativePath => path.resolve(appDirectory, relativePath);
11 |
12 | const envPublicUrl = process.env.PUBLIC_URL;
13 |
14 | function ensureSlash(inputPath, needsSlash) {
15 | const hasSlash = inputPath.endsWith('/');
16 | if (hasSlash && !needsSlash) {
17 | return inputPath.substr(0, inputPath.length - 1);
18 | } else if (!hasSlash && needsSlash) {
19 | return `${inputPath}/`;
20 | } else {
21 | return inputPath;
22 | }
23 | }
24 |
25 | const getPublicUrl = appPackageJson =>
26 | envPublicUrl || require(appPackageJson).homepage;
27 |
28 | // We use `PUBLIC_URL` environment variable or "homepage" field to infer
29 | // "public path" at which the app is served.
30 | // Webpack needs to know it to put the right
14 |
24 |
25 |
26 |
35 |