Skip to content

Commit e35835c

Browse files
committed
introducing static.21no.de
1 parent f7b4090 commit e35835c

File tree

4 files changed

+130
-71
lines changed

4 files changed

+130
-71
lines changed

README.md

Lines changed: 3 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# restana-static
1+
# Introduction
22
[![build images](https://github.com/BackendStack21/restana-static/actions/workflows/build_images.yaml/badge.svg)](https://github.com/BackendStack21/restana-static/actions/workflows/build_images.yaml)
33

44
Efficiently serve static files using Node.js and Docker containers: https://itnext.io/restana-static-serving-the-frontend-with-node-js-beyond-nginx-e45fdb2e49cb
@@ -9,73 +9,5 @@ RUN rm dist/index.html
99
RUN echo "Hello World!" >> dist/index.html
1010
```
1111

12-
## Configuration options
13-
restana-static image configuration is manage using the module: https://www.npmjs.com/package/config, so developers can manage multiple envirments if desired.
14-
15-
The `/restana-static/config` directory should be populated/overwritten during image creation.
16-
17-
### Default configuration:
18-
```json
19-
{
20-
"port": 3000,
21-
"cacheEnabled": true,
22-
"cacheControlHeaderValue": "public, no-cache, max-age=604800",
23-
"distDirectory": "dist/",
24-
"defaultFile": "index.html",
25-
"logsEnabled": true,
26-
"logsFormat": "tiny"
27-
}
28-
```
29-
> File location : `/restana-static/config/default.json`
30-
31-
### Environment configuration
32-
Optionally, you can overwrite each configuration entry using corresponding environment variables.
33-
```bash
34-
# port
35-
PORT
36-
# cacheEnabled
37-
CACHE_ENABLED
38-
# cacheControlHeaderValue
39-
CACHE_CONTROL_HEADER_VALUE
40-
# distDirectory
41-
DIST_DIRECTORY
42-
# defaultFile
43-
DEFAULT_FILE
44-
# logsEnabled
45-
LOGS_ENABLED
46-
# logsFormat
47-
LOGS_FORMAT
48-
```
49-
50-
## Adding static files
51-
The `/restana-static/dist` directory should be populated/overwritten during image creation.
52-
> Please consider that default path will change if you overwrite the `distDirectory` config.
53-
54-
## Log formats
55-
Logs are provided by the module: https://www.npmjs.com/package/morgan
56-
57-
Allowed `logsFormat` values are described at: https://www.npmjs.com/package/morgan#predefined-formats
58-
59-
## Cache support
60-
Caching is provided by the module: https://www.npmjs.com/package/http-cache-middleware
61-
62-
## Custom middlewares
63-
You can also introduce other features such as authentication, security protections, etc... by using custom middlewares.
64-
You can just replace the `middlewares.js` file by your own configuration.
65-
66-
Default:
67-
```js
68-
// custom middlewares set
69-
// this file is intended to be overwritten by final images
70-
const helmet = require('helmet')
71-
72-
module.exports = [
73-
helmet
74-
]
75-
```
76-
> Please note that the `helmet` middleware enabled by default. See more details here: https://www.npmjs.com/package/helmet
77-
78-
## Support / Donate 💚
79-
You can support the maintenance of this project:
80-
- PayPal: https://www.paypal.me/kyberneees
81-
- [TRON](https://www.binance.com/en/buy-TRON) Wallet: `TJ5Bbf9v4kpptnRsePXYDvnYcYrS5Tyxus`
12+
# More
13+
- Website and documentation: https://static.21no.de

docs/.nojekyll

Whitespace-only changes.

docs/README.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Introduction
2+
[![build images](https://github.com/BackendStack21/restana-static/actions/workflows/build_images.yaml/badge.svg)](https://github.com/BackendStack21/restana-static/actions/workflows/build_images.yaml)
3+
4+
Efficiently serve static files using Node.js and Docker containers: https://itnext.io/restana-static-serving-the-frontend-with-node-js-beyond-nginx-e45fdb2e49cb
5+
6+
```Dockerfile
7+
FROM kyberneees/restana-static:latest
8+
RUN rm dist/index.html
9+
RUN echo "Hello World!" >> dist/index.html
10+
```
11+
12+
# Configuration options
13+
restana-static image configuration is manage using the module: https://www.npmjs.com/package/config, so developers can manage multiple envirments if desired.
14+
15+
The `/restana-static/config` directory should be populated/overwritten during image creation.
16+
17+
## Default configuration:
18+
```json
19+
{
20+
"port": 3000,
21+
"cacheEnabled": true,
22+
"cacheControlHeaderValue": "public, no-cache, max-age=604800",
23+
"distDirectory": "dist/",
24+
"defaultFile": "index.html",
25+
"logsEnabled": true,
26+
"logsFormat": "tiny"
27+
}
28+
```
29+
> File location : `/restana-static/config/default.json`
30+
31+
## Environment based configuration
32+
Optionally, you can overwrite each configuration entry using corresponding environment variables.
33+
```bash
34+
# port
35+
PORT
36+
# cacheEnabled
37+
CACHE_ENABLED
38+
# cacheControlHeaderValue
39+
CACHE_CONTROL_HEADER_VALUE
40+
# distDirectory
41+
DIST_DIRECTORY
42+
# defaultFile
43+
DEFAULT_FILE
44+
# logsEnabled
45+
LOGS_ENABLED
46+
# logsFormat
47+
LOGS_FORMAT
48+
```
49+
50+
# Adding static files
51+
The `/restana-static/dist` directory should be populated/overwritten during image creation.
52+
> Please consider that default path will change if you overwrite the `distDirectory` config.
53+
54+
# Log formats
55+
Logs are provided by the module: https://www.npmjs.com/package/morgan
56+
57+
Allowed `logsFormat` values are described at: https://www.npmjs.com/package/morgan#predefined-formats
58+
59+
# Cache support
60+
Caching is provided by the module: https://www.npmjs.com/package/http-cache-middleware
61+
62+
# Custom middlewares
63+
You can also introduce other features such as authentication, security protections, etc... by using custom middlewares.
64+
You can just replace the `middlewares.js` file by your own configuration.
65+
66+
Default:
67+
```js
68+
// custom middlewares set
69+
// this file is intended to be overwritten by final images
70+
const helmet = require('helmet')
71+
72+
module.exports = [
73+
helmet
74+
]
75+
```
76+
> Please note that the `helmet` middleware enabled by default. See more details here: https://www.npmjs.com/package/helmet
77+
78+
# Support / Donate 💚
79+
You can support the maintenance of this project:
80+
- PayPal: https://www.paypal.me/kyberneees
81+
- [TRON](https://www.binance.com/en/buy-TRON) Wallet: `TJ5Bbf9v4kpptnRsePXYDvnYcYrS5Tyxus`

docs/index.html

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<title>restana-static</title>
7+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
8+
<meta name="description" content="Efficiently serve static files using Node.js and Docker containers">
9+
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
10+
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify@4/lib/themes/vue.css">
11+
</head>
12+
13+
<body>
14+
<div id="app"></div>
15+
<script>
16+
window.$docsify = {
17+
name: 'restana-static',
18+
repo: 'https://github.com/BackendStack21/restana-static',
19+
share: {
20+
reddit: false,
21+
linkedin: true,
22+
facebook: true,
23+
twitter: true,
24+
whatsapp: true,
25+
telegram: true,
26+
}
27+
}
28+
</script>
29+
<!-- Docsify v4 -->
30+
<script src="//cdn.jsdelivr.net/npm/docsify@4"></script>
31+
32+
<script src="https://unpkg.com/docsify-copy-code@2"></script>
33+
<script src="https://unpkg.com/docsify-share/build/index.min.js"></script>
34+
35+
<!-- Global site tag (gtag.js) - Google Analytics -->
36+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-MY8LSX7YZJ"></script>
37+
<script>
38+
window.dataLayer = window.dataLayer || [];
39+
function gtag() { dataLayer.push(arguments); }
40+
gtag('js', new Date());
41+
42+
gtag('config', 'G-MY8LSX7YZJ');
43+
</script>
44+
</body>
45+
46+
</html>

0 commit comments

Comments
 (0)