<tt>made by Fabboy </tt> <hr> <br>
npm install dozehost
npm install dozehost
`
2. Create a server file where you can host your website for example "server.js"
3. Create a root folder where your website is located for example "root"Current file structure:
(i also create a "index.html" file)
`
βββ root
β βββ index.html
βββ server.js
`
4. Setup the Server script to run your website
(This script can be various depending on your server setup)
`js
//import the package
const dozehost = require("dozehost")
//create a server
const doze = new dozehost("./root", 3030, "index.html") //set the root folder, the port, and the default file
//redirect all requests on empty / to the default file
doze.redirect("/", "/index.html")
// start the host
doze.serve()
//print the url
console.log("http://localhost:" + doze.port)
`
5. Open your browser and go to http://localhost:3030 to see your website π
Now the file structure should look like this:
`
βββ root
β βββ serverAssets
β β βββ 404.html
β β βββ redirect.json
β βββ debug
β β βββ ips.json
β β βββ debug.log
β βββ index.html
βββ server.js
``The script will create a redirect.json file with all redirects in it. You can add and remove redirects from the redirect.json file.
The script will also create a 404.html file if it doesn't find a file. You can edit the 404.html file.
The script will also create a debug.log file
The script will also create a ips.json with all the ips that have visited the website and their userid.