Hello guys. I am trying to make a HTML site for my discord bot. (Project : here ). In the tutorials, it needs to have a package.json and server.js but these files broke the Static Site mode. I want to make it so it still shows 404 page but its still a Static Page.
(Note : i just entered the site so you will directly see the main page.)
Hi @mustafa !
This is the only way I found, courtesy of @aboutdavid :
You can use 404 pages on glitch with this simple snippet:
null.config.js
const execSync = require("child_process").execSync;
execSync("npx http-server ./ -p 3000 -c-1");
process.on("beforeExit", code => {
execSync("refresh");
});
process.on("exit", code => {
execSync("refresh");
});
Now make a file called 404.html and place whatever you want into it. Run the refresh command for the changes to take effect.
Hope this helps
Eddie
5 Likes
Thank you eddie but it didnt worked Im getting not found error again. i will try it some time and if it didnt worked i will notify you
hey guys i was looking to web for solutions and found a solution but it wants to have a .htaccess file. how can i find it? or should i create it?
You can use a .htaccess file in ~hello-httpd
can i create a file just named .htaccess or should i add something to my code?
I know this topic but this tutorial has package.json in it that gets project out of Static Site.
system
Closed
August 1, 2021, 6:16pm
9
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.