Skip to content

Commit

Permalink
First Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ItzOuluhh committed Jun 15, 2023
0 parents commit 17abf1c
Show file tree
Hide file tree
Showing 27 changed files with 5,235 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
],
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
settings: { react: { version: '18.2' } },
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': 'warn',
},
}
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
59 changes: 59 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Error Code Pages

This package is made for the people who don't feel like creating their own error page. It contains all HTML codes, 100, 200, 300, 400 and 500.

It is super fast to use and easy for people who need a super simple yet beautiful html code page.

## Get Started

Install the package

```bash
npm install html-code-pages
```

Create your first error page

```js
import { NotFound } from "html-code-pages";
import React from "react";

// EXAMPLE PAGE //

function App() {
return (
<>
<NotFound />
</>
);
}
export default App;
```

With custom error description

```js
import { OK } from "html-code-pages/lib/200"; // Imports only 200 errors
import React from "react";

// EXAMPLE PAGE //

function App() {
return (
<>
<OK customText="This is a 404 error!" />
</>
);
}
export default App;
```

##### This example is based on a react project!

## Screenshots

![App Screenshot](https://cdn.discordapp.com/attachments/863316298129080331/1118954928623341681/image.png)

## Authors

- [@ItzOuluhh](https://github.com/ItzOuluhh)
19 changes: 19 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React</title>

<link rel="stylesheet" href="./src/styles/index.css" />
<!-- GOOGLE FONTS -->
<style>
@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@200;300;400;500;600;700;800&family=Open+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400;1,500;1,600;1,700;1,800&family=Poppins:wght@100;200;300;400;500;600&family=Roboto:wght@100;300;400;500;700&family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap");
</style>
</head>
<body class="ma-2bd">
<div id="root_2"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
150 changes: 150 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
import {
BadRequest,
Unauthorized,
PaymentRequired,
Forbidden,
NotFound,
MethodNotAllowed,
NotAcceptable,
ProxyAuthenticationRequired,
RequestTimeout,
Conflict,
Gone,
LengthRequired,
PreconditionFailed,
PayloadTooLarge,
URITooLong,
UnsupportedMediaType,
RangeNotSatisfiable,
ExpectationFailed,
ImATeapot,
MisdirectedRequest,
UnprocessableEntity,
Locked,
FailedDependency,
TooEarly,
UpgradeRequired,
PreconditionRequired,
TooManyRequests,
RequestHeaderFieldsTooLarge,
UnavailableForLegalReasons,
} from "./src/handlers/clientErrors";

import {
Continue,
SwitchingProtocols,
Processing,
EarlyHints,
} from "./src/handlers/informationalHandler";

import {
MultipleChoices,
MovedPermanently,
Found,
SeeOther,
NotModified,
UseProxy,
SwitchProxy,
TemporaryRedirect,
PermanentRedirect,
} from "./src/handlers/redirectionHandler";

import {
OK,
Created,
Accepted,
NonAuthoritativeInformation,
NoContent,
ResetContent,
PartialContent,
MultiStatus,
AlreadyReported,
IMUsed,
} from "./src/handlers/succesHandler";

import {
InternalServerError,
NotImplemented,
BadGateway,
ServiceUnavailable,
GatewayTimeout,
HTTPVersionNotSupported,
VariantAlsoNegotiates,
InsufficientStorage,
LoopDetected,
NotExtended,
NetworkAuthenticationRequired,
} from "./src/handlers/serverErrors";

export {
BadRequest,
Unauthorized,
PaymentRequired,
Forbidden,
NotFound,
MethodNotAllowed,
NotAcceptable,
ProxyAuthenticationRequired,
RequestTimeout,
Conflict,
Gone,
LengthRequired,
PreconditionFailed,
PayloadTooLarge,
URITooLong,
UnsupportedMediaType,
RangeNotSatisfiable,
ExpectationFailed,
ImATeapot,
MisdirectedRequest,
UnprocessableEntity,
Locked,
FailedDependency,
TooEarly,
UpgradeRequired,
PreconditionRequired,
TooManyRequests,
RequestHeaderFieldsTooLarge,
UnavailableForLegalReasons,
};

export { Continue, SwitchingProtocols, Processing, EarlyHints };

export {
MultipleChoices,
MovedPermanently,
Found,
SeeOther,
NotModified,
UseProxy,
SwitchProxy,
TemporaryRedirect,
PermanentRedirect,
};

export {
OK,
Created,
Accepted,
NonAuthoritativeInformation,
NoContent,
ResetContent,
PartialContent,
MultiStatus,
AlreadyReported,
IMUsed,
};

export {
InternalServerError,
NotImplemented,
BadGateway,
ServiceUnavailable,
GatewayTimeout,
HTTPVersionNotSupported,
VariantAlsoNegotiates,
InsufficientStorage,
LoopDetected,
NotExtended,
NetworkAuthenticationRequired,
};
8 changes: 8 additions & 0 deletions lib/100.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import {
Continue,
SwitchingProtocols,
Processing,
EarlyHints,
} from "../src/handlers/informationalHandler";

export { Continue, SwitchingProtocols, Processing, EarlyHints };
25 changes: 25 additions & 0 deletions lib/200.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import {
OK,
Created,
Accepted,
NonAuthoritativeInformation,
NoContent,
ResetContent,
PartialContent,
MultiStatus,
AlreadyReported,
IMUsed,
} from "../src/handlers/succesHandler";

export {
OK,
Created,
Accepted,
NonAuthoritativeInformation,
NoContent,
ResetContent,
PartialContent,
MultiStatus,
AlreadyReported,
IMUsed,
};
23 changes: 23 additions & 0 deletions lib/300.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import {
MultipleChoices,
MovedPermanently,
Found,
SeeOther,
NotModified,
UseProxy,
SwitchProxy,
TemporaryRedirect,
PermanentRedirect,
} from "../src/handlers/redirectionHandler";

export {
MultipleChoices,
MovedPermanently,
Found,
SeeOther,
NotModified,
UseProxy,
SwitchProxy,
TemporaryRedirect,
PermanentRedirect,
};
63 changes: 63 additions & 0 deletions lib/400.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import {
BadRequest,
Unauthorized,
PaymentRequired,
Forbidden,
NotFound,
MethodNotAllowed,
NotAcceptable,
ProxyAuthenticationRequired,
RequestTimeout,
Conflict,
Gone,
LengthRequired,
PreconditionFailed,
PayloadTooLarge,
URITooLong,
UnsupportedMediaType,
RangeNotSatisfiable,
ExpectationFailed,
ImATeapot,
MisdirectedRequest,
UnprocessableEntity,
Locked,
FailedDependency,
TooEarly,
UpgradeRequired,
PreconditionRequired,
TooManyRequests,
RequestHeaderFieldsTooLarge,
UnavailableForLegalReasons,
} from "../src/handlers/clientErrors";

export {
BadRequest,
Unauthorized,
PaymentRequired,
Forbidden,
NotFound,
MethodNotAllowed,
NotAcceptable,
ProxyAuthenticationRequired,
RequestTimeout,
Conflict,
Gone,
LengthRequired,
PreconditionFailed,
PayloadTooLarge,
URITooLong,
UnsupportedMediaType,
RangeNotSatisfiable,
ExpectationFailed,
ImATeapot,
MisdirectedRequest,
UnprocessableEntity,
Locked,
FailedDependency,
TooEarly,
UpgradeRequired,
PreconditionRequired,
TooManyRequests,
RequestHeaderFieldsTooLarge,
UnavailableForLegalReasons,
};
Loading

0 comments on commit 17abf1c

Please sign in to comment.