Manga Reader with many sources (Komikindo, Mangabat)
- Require Node.js 14.x.x;
- type npm install on terminal;
- type node . to running web server;
- Install Nginx in WSL/Linux
- Install php & php7.4-fpm
- edit nginx config
# Default server configuration # server { listen 80 default_server; listen [::]:80 ipv6only=on default_server; # SSL configuration # # listen 443 ssl default_server; # listen [::]:443 ssl default_server; # # Note: You should disable gzip for SSL traffic. # See: https://bugs.debian.org/773332 # # Read up on ssl_ciphers to ensure a secure configuration. # See: https://bugs.debian.org/765782 # # Self signed certs generated by the ssl-cert package # Don't use them in a production server! # # include snippets/snakeoil.conf; root /home/kato/manga-reader/web; # Add index.php to the list if you are using PHP index index.php; server_name _; rewrite /login /login.php last; rewrite /logout /logout.php last; location /komikindo { try_files $uri $uri/ =404; rewrite /search/page/(.*)$ /komikindo/index.php?p=$1 last; rewrite /chapter/(.*)$ /komikindo/index.php?c=$1 last; rewrite /favorite /komikindo/index.php?f=a last; } location /mangabat { try_files $uri $uri/ =404; rewrite /search/(.*)$ /mangabat/index.php?s=$1 last; rewrite /chapter/(.*)$ /mangabat/index.php?c=$1 last; rewrite /favorite /mangabat/favorite.php last; } location /otakudesu { try_files $uri $Uri/ =404; rewrite /search/(.*)$ /otakudesu/index.php?s=$1 last; rewrite /eps/(.*)$ /otakudesu/index.php?c=$1 last; } # API location ~ ^/api/(.*)$ { proxy_pass http://127.0.0.1:4873/api/$1; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } location ~ ^/komikindo/api/(.*)$ { proxy_pass http://127.0.0.1:4873/komikindo/api/$1; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } location ~ ^/mangabat/api/(.*)$ { proxy_pass http://127.0.0.1:4873/mangabat/api/$1; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } location ~ ^/otakudesu/api/(.*)$ { proxy_pass http://127.0.0.1:4873/otakudesu/api/$1$is_args$args; proxy_set_header Host $host; } # pass PHP scripts to FastCGI server # location ~ \.php$ { fastcgi_pass unix:/run/php/php7.4-fpm.sock; fastcgi_intercept_errors on; fastcgi_index index.php; fastcgi_split_path_info ^(.+\.php)(.*)$; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} }- Run Nginx and php7.4-fpm
- open url localhost/ in browser
- cd path to rest-api/
- run node terminal
- type per step like this
> const db = require('quick.db'); > const tb = new db.table('account'); > tb.set('username', { username: 'username', password: 'password' ,user_id: 'user_id', favorites: [] });