forked from SiTLar/pyt-vanilla-html
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from SiTLar/master
update
- Loading branch information
Showing
65 changed files
with
12,076 additions
and
2,107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
|
||
*.swp | ||
config.json | ||
|
||
config.json | ||
|
||
favicon.ico | ||
node_modules | ||
vanilla*.js | ||
compact.css | ||
expanded.css |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,51 @@ | ||
# pyp-vanila-html | ||
The master branch is available at [http://moimosk.ru/frf/](http://moimosk.ru/frf/) | ||
# pyt-vanilla-html | ||
The master branch is available at <http://myfeed.rocks/b/> | ||
## Setup | ||
You may want to edit `domains.json` for information about supported back ends. | ||
|
||
Use `tools/deploy.sh` to collect all the necessary stuff in a desired deployment directory | ||
|
||
You can do it manually, with the following steps: | ||
|
||
1. Install necessary npm modules: `$ npm install` | ||
1. Run webpack `$ webpack --config config.js` to make a bundle file | ||
1. Copy the files listed in `release.lst` to a deployment directory | ||
1. Optionally you can edit `index.html` and update md5 hash values of `vanilla.js` and `config.json` to prevent caching outdated files | ||
|
||
Then put there and edit `config.josn`: | ||
- the path on your server as "front" | ||
- the path to the files as "static" | ||
- the list of back ends you want to serve in "domains" | ||
|
||
Then set up the web server to rewrite all the requests to `index.html`, accept those which go to `static` | ||
|
||
To have server-side rendering install necessary npm modules: `$ npm install` | ||
|
||
Create server-side rendering script `$ webpack --config config_srv.js` | ||
|
||
Use the function exported by `vanilla_srv.js` module to handle http requests with `http.createServer`. First parameter is the request, second is the response. | ||
|
||
### Example | ||
You put everything in `/var/pyt-vanilla-html` web directory and you want to access it form `/vanilla` | ||
|
||
`$ tools/deploy.sh -d /var/pyt-vanilla-html` | ||
|
||
Then you add the following to your web server config: | ||
``` | ||
... | ||
location ~ /vanilla/ { | ||
add_header Cache-Control no-cache; | ||
rewrite ^/vanilla/s(/.*) /pyt-vanilla-html$1 break; | ||
rewrite ^.* /pyt-vanilla-html/index.htm break; | ||
} | ||
... | ||
``` | ||
And `config.json` | ||
``` | ||
var gConfig = { | ||
"front":"https://{mydomain}/vainlla/" | ||
, "static":"https://{mydomain}/vainlla/s/" | ||
, "leadDomain": "FreeFeed" | ||
, domains: ["FreeFeed", "MyOtherFF"] | ||
... | ||
``` |
Oops, something went wrong.