A Node.js web application template with explicit assets, routes, build, and deployment boundaries.
- Features
- Requirements
- Setup
- Usage
- Development
- Testing
- Troubleshooting
- Security
- Configuration
- Operations
- Routes
- Assets
- Development server
- Build
- Deployment
- Support
- Links
- License
This template provides a reusable starting point. Each derived repository owns its product behavior and operating decisions.
Use Node.js 26 or later and npm 12 or later for repository validation.
Create a repository from this template. Replace the template name, description, URLs, keywords, and sample content.
Run npm ci from the repository root.
Follow this README and the user guide. Read release notes for release history.
Read AGENTS.md and the specifications index before you change files. Keep documents and records in the repository that owns them.
Run npm test before handoff. It runs the repository checks through eliware-test.
Install the required Node.js and npm versions. Run npm ci after dependency changes.
Review the file and rule in any validation error.
Keep credentials, secrets, private data, and runtime state out of Git. Use only approved secret stores for secret values.
PORT defaults to 3000 and accepts integers from 1 through 65535. LOG_LEVEL defaults to info.
Set LOG_LEVEL to error, warn, info, http, verbose, debug, or silly.
Run npm run build, then run node bin/web-template.mjs. The server listens on port 3000 by default.
Build a local image with docker build -t web-template ..
Template setup — update these values after you create a web application repository.
This template has no published image. Set the image visibility to public or private. Set who can pull it. The workflow builds
linux/amd64; confirm or change the supported architectures. Name the owner for build inputs and architecture decisions. Update this section and the publication workflow before you publish an image.
Deploy with an approved version tag and its recorded SHA-256 digest. Image publication does not deploy the site.
| Method | Path | Result |
|---|---|---|
GET |
/ |
Serves public/index.html. |
GET |
/client.js |
Serves dist/client.js. |
| Other methods | Any path | Returns HTTP 405. |
GET |
Other paths | Returns HTTP 404. |
Keep source assets in public/. The build creates dist/client.js.
Keep generated files out of public/. The image includes the page and browser bundle.
Run npm run build, then run node bin/web-template.mjs.
Run npm run puppeteer to install Chrome. Start the server, then run npm run lighthouse. The report goes to ignored artifacts/.
Run npm run build to bundle src/client-entry.mjs as dist/client.js.
The aggregate npm test command runs the build. The build output is generated and does not belong in source control.
The repository owns the application, image, and publication configuration. Publication does not deploy or start the site. Use an approved GitOps handoff for deployment and rollback.
For help, questions, or to chat with the author and community, visit:


