How to deploy it to xampp?
npm run build -- --release
builds my files okey, but what should i do to let it run in xampp, i think i do something wrong sry im new. I created a index.html but i get the error:
Unhandled promise rejection SyntaxError: Unexpected token <
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script async src="./public/main.319b23d5d2f13152b6db.js"></script>
</head>
<body>
</body>
</html>
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
@neridonk First you need run nodejs server as deamon (simplest way - see "pm2" or "forever") Then you need configure web server as proxy for you app.
Structure:
(client) ==== (web server nginx/apache/xamp/others) ==== (nodejs daemon on 5000)
For example apache2 with mod_proxy:
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName my.com
ProxyRequests off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
<Location />
ProxyPass http://localhost:5000/
ProxyPassReverse http://localhost:5000/
</Location>
</VirtualHost>
For nginx proxy:
upstream nodeserver {
server 127.0.0.1:5000;
}
# the nginx instance
server {
listen 0.0.0.0:80;
server_name my.com;
access_log /var/log/nginx/my.com.log;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://nodeserver/;
proxy_redirect off;
}
}
@neridonk thank you very much for crating this issue! Unfortunately, we have close it due to inactivity. Feel free to re-open it or join our Discord channel for discussion.
NOTE: The main branch has been updated with React Starter Kit v2, using JAM-style architecture.