
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@gudhub/webserver
Advanced tools
You can use this web server in 2 defferent ways. In server mode and in local development mode:
If you creating website with @gudhub/ssg-website-cli, you need to use local development mode. To do this, you need to install this package globally, with command:
npm i @gudhub/webserver -g
Then, after starting website build, you need to start webserver. In another terminal type:
gudhub-web-server
Server must automaticaly start on 777 port. You can pass flags to customize server:
| Flag | Default | Description |
|---|---|---|
| -p 8000 | 7777 | Start server on specified port (8000 in this case) |
| -host localhost | 127.0.0.1 | Start server on specified host (localhost in this case). Can be used to start server on local ip address. |
In server mode, you need to clone repo with code, install packages, and configure env. In this mode, you can server multiple websites from websites folder.
All documentation bellow will be about Server mode
For now, you have few ways of how to add new pages/routes to your website.
By creating html files. You can create html in root of your website folder. In this case, route will be the same as file name. Also, you can create folders, and put your html files there. Each folder will have subdirectory in route. For example, if you will create structure like this: website.com/services/consulting.html, this page will be accessible by this url: https://website.com/services/consulting/. Additionally, you can create structure like this: website.com/services/consutling/index.html and will have same result.
By adding route in routes array in comfig.js. You can also add object like this to routes array in config.js
{
route: '/services/consulting/', // Route for accessing page
index: '/whatever/services/consulting.html' // Path to html file, that will be rendered, from root of your website folder
}
By using this example, you will have ability to create dynamic routes. To do this, you must add object like this to routes array.
{
route: '/blog/:category/:article/', // Route for accessing page. Dynamic parts of route should start from :
index: '/whatever/blog/article.html' // Path to html file, that will be rendered, from root of your website folder
}
Value of this dynamic parts will be accessible on server side inside query parameters like this: ?category=services&article=why-consulting-is-so-important
By default, after first visit of page in production mode, will be generated cache for this page. In future visit, only this cache will be served on request, If you want update cache - you need open page with query parameter mode with value ssr: ?mode=ssr. You will receive fresh generated code. Also, this new code will be saved as cache, replacing the old ones. You can disable caching while developing by simply setting MODE env variable to 'development'.
FAQs
## Server and local development modes
We found that @gudhub/webserver demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.