Simple echo service
This is an echo service that will listen on 9595 and return a 200 OK
The PARALLELISM variable defaults to 2. Set an environment variable with the same name to change parallelism.
To build the docker image, execute docker build --tag echoservice:0.0.1 .
- Node.js v22.15
To set up the project locally:
-
Fork the repository on GitHub
-
Clone your fork:
git clone https://github.com/your-username/sunbird-echo-service.git
cd sunbird-echo-service
- Install dependencies:
npm i
The project maintains code quality through automated checks that run on every pull request:
-
Linting
- ESLint for code style and quality
- Command:
npm run lint
-
Dependencies
- Uses
npm ci
for deterministic installations - GitHub Actions cache for faster builds
- Uses
-
Code Formatting
- Ensures consistent code formatting
- Can be automatically fixed using
npm run lint:fix
These checks ensure consistent code style and secure dependency management.
This repository uses GitHub Actions to automatically build and publish Docker container images to GitHub Container Registry (GHCR) whenever a new tag is pushed to the repository.
The workflow is triggered on:
- creation of any tag
Key features of the workflow:
- Automatically builds Docker images
- Tags images with a combination of:
- The tag name (lowercased)
- Short commit hash
- GitHub run number
- Publishes images to
ghcr.io
using the repository name - Uses GitHub Actions for secure authentication to GHCR
The Docker images follow this naming convention:
- Repository:
ghcr.io/${OWNER_NAME}/${REPO_NAME_LOWERCASE}
- Tag:
${TAG_NAME}_${COMMIT_HASH}_${RUN_NUMBER}
For example, if you push a tag v1.0.0
on commit abc123
, the resulting image would be:
ghcr.io/project-sunbird/sunbird-echo-service:v1.0.0_abc123_1