Skip to content

Commit

Permalink
Updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadnasriya committed Jul 16, 2024
1 parent 5a1eca6 commit 2620cc2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ ___

___
## Status [![Status](https://img.shields.io/badge/Status-Stable-green.svg)](link-to-your-status-page)
If you encounter one, please [open an issue](https://github.com/nasriyasoftware/HyperCloud/issues).
If you encounter an issue or a bug, please [open an issue](https://github.com/nasriyasoftware/HyperCloud/issues).
___
## Quick Start Quide
## Quick Start Guide
Quickly run a `HyperCloud` server in **5** easy steps.

#### 1. Installation
Expand All @@ -36,7 +36,7 @@ npm i @nasriya/hypercloud
```

#### 2. Importing
Importing in **ES6** modules
Importing in **ESM** modules
```js
import hypercloud from '@nasriya/hypercloud';
```
Expand Down Expand Up @@ -88,7 +88,7 @@ Congratulations! Your server is now ready to handle requests.

___
## Features
HyperCloud has more featues and advanced configurations.
HyperCloud has more features and advanced configurations.

#### Enable Debugging
You can enable debugging to get more details about operations and errors.
Expand Down Expand Up @@ -128,14 +128,14 @@ server.languages.supported = ['en', 'ar', 'de'];
```

###### Default Language
If a user doesn't have a preferred language, the browser's language is selected then checked against the server's [supported languages](#supported-languages), if the browser's language isn't supported, the server's `languages.default` is used to render pages or serve other language-related content.
If a user doesn't have a preferred language, the browser's language is selected then checked against the server's [supported languages](#supported-languages), if the browser's language isn't supported, the server's `default` language is used to render pages or serve other language-related content.

To set a default language:
```js
server.languages.default = 'ar';
```

**Note:** The `languages.default` must be one of the [supported languages](#supported-languages) or an error will be thrown.
**Note:** The `default` language must be one of the [supported languages](#supported-languages) or an error will be thrown.

#### HyperCloud Built-In User
HyperCloud provides a built-in `HyperCloudUser` on each `request` and allows you to populate it using a [custom handler](https://github.com/nasriyasoftware/HyperCloud/blob/main/examples/request-user.md#user-handler), you can then access the `user` object from any route via the `request` object.
Expand All @@ -155,11 +155,11 @@ The built-in `user` object looks like this:
}
}
```
Learn how to populate and `request.user` object and work with it [here](https://github.com/nasriyasoftware/HyperCloud/blob/main/examples/request-user.md).
Learn how to populate the `request.user` object and work with it [here](https://github.com/nasriyasoftware/HyperCloud/blob/main/examples/request-user.md).

#### Error Handling & Pages

**HyperCloud** provides three built-in error pages out of the box, `401`, `403`, `404`, and `500`. You can render these pages from your code and customize them with your own text, or you can set custom handlers to run whenever you needed.
**HyperCloud** provides four built-in error pages out of the box, `401`, `403`, `404`, and `500`. You can render these pages from your code and customize them with your own text, or you can set custom handlers to run whenever you needed.

To render error pages, just call them from the `pages` module in the `response` object.

Expand Down Expand Up @@ -202,7 +202,7 @@ server.handlers.logger(logify.middlewares.hypercloud);
```

#### Generating eTags
[ETags](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) can signifucantly improve server performance. To generate `eTags` for your resources, use the following syntax:
[ETags](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) can significantly improve server performance. To generate `eTags` for your resources, use the following syntax:

```js
import path from 'path';
Expand Down
4 changes: 2 additions & 2 deletions examples/server-side-rendering-ssr.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ___
### Files Syntax
When defining pages or components, there's a syntax that you must follow in order for the renderer to detect and register your defined pages and components.

- **Pages:** `*.page.js`. For example: `home.pae.js`.
- **Pages:** `*.page.js`. For example: `home.page.js`.
- **Components:** `*.comp.js` or `*.component.js`. Example: `header.comp.js` or `header.component.js`.
___

Expand Down Expand Up @@ -111,7 +111,7 @@ export default page;
```
### 2- Register Assets
After creating and assets (pages and components), we need to register them on the server.
After creating the assets (pages and components), we need to register them on the server.
##### Registering Pages & Components
To register our pages and components, we tell the server where it can find them by providing the containing folder.
Expand Down

0 comments on commit 2620cc2

Please sign in to comment.