Platform is build to host static webisites
- updating code from website
- update website every single time
- change the subdoamin of website
- set visibilty of website ( public / private )
- Store website assets
- Node , MongoDb must installed in local mechine
- Run following command's to download required package's
npm i express mongoose adm-zip multer bcrypt dotenv ejs cookie-parser jsonwebtoken
- Add
.envfile in project and add following code
PORT={port numner}
MONGOOSE_URL={mongoose url}
JWT_SECRET={your secret}
DOMAIN=http://localhost:{port number}
- Open cmd in same folder where app.js exists and run following commad
npm start
- Your server will be start on
http://locahost:{port number} - Paste this link in any browser and you will get access of website
- Compress website in single folder ( public )
- uploade thie folder, you will get the website link to access site online
- ex. localhost:{ port number }/
demo-example/webhost.web.app
- Go to website setting's
- Set Visibility of website
- If visibilty is public then it is visible to everyone
- If visibilty is private then it is only visible to authenticated user
<form action="/login" method="post">
<input type="text" name="userName" required>
<input type="password" name="password" required>
<button type="submit">Upload</button>
</form>
<form action="/register" method="post">
<input type="text" name="userName" required>
<input type="email" name="email" required>
<input type="radio" name="visibility" value="true" checked>
<input type="radio" name="visibility" value="false">
<input type="password" name="password" required>
<button type="submit">Upload</button>
</form>
Note : User browser shoud store cookies stored by server
<form action="/logout">
<button type="submit">Logout</button>
</form>
Note: This platform sends cookies after login if your not using web browser then you shoud send this cookies with every request with name secret.
Add Website name dynamically
<form action="/:website/setting" method="post">
<input type="text" name="domain" required>
<input type="text" name="defaultPageName" required>
<input type="text" name="visibility" required>
<button type="submit">Upload</button>
</form>
Note: This platform sends cookies after login if your not using web browser then you shoud send this cookies with every request with name secret
- User must be
Logged Inwithout authencation we can't change anything
<form action="/create/website" method="post" enctype="multipart/form-data">
<input type="file" id="folder" name="folder" accept=".zip" required>
<button type="submit">Upload</button>
</form>
- User must be
Logged Inwithout authencation we can't change anything
<form action="/change/domain/" method="post">
<input type="text" name="oldName" required>
<input type="text" name="newName" required>
<input type="submit">
</form>
- User must be
Logged Inwithout authencation we can't change anything
<form action="/change/visibility" method="post">
<input type="text" name="websiteName" required>
<select name="isVisible">
<option value="true">Public</option>
<option value="false">Private</option>
</select>
<input type="submit" value="Submit">
</form>
- User Must be
Logged InHere it will find all resently added sites using logged user id
<form action="/resentsites">
<input type="submit" value="Submit">
</form>
- User must be
Logged In
<form action="/sites">
<input type="submit" value="sites">
</form>