This repository is a template for microservice development, designed to be platform-independent. It emphasizes abstraction over implementation, making it adaptable for various environments.
-
Clone the repository:
git clone https://github.com/your-username/microservice-dev.git cd microservice-dev -
Install dependencies:
npm install
Start the development database using json-server:
npm run dev:databaseThis starts a JSON server on port 8000, serving data from tests/.data.json.
To build and run the Express.js platform:
npm run build:expressThis command:
- Runs the build script for the Express.js platform.
- Builds a Docker image for the Express.js platform.
- Uses
docker-composeto start the containerized application.
To build and run the Cloudflare platform:
npm run build:cloudflareThis command:
- Runs the build script for the Cloudflare platform.
- Builds a Docker image for the Cloudflare platform.
- Uses
docker-composeto start the containerized application.
microservice-dev/
├── src/
│ ├── platform/
│ │ ├── express/
│ │ │ └── build.js
│ │ ├── cloudflare/
│ │ │ └── build.js
│ └── ...
├── tests/
│ └── .data.json
├── build/
│ ├── express/
│ ├── cloudflare/
├── Dockerfile
├── docker-compose.yml
├── package.json
└── .dockerignore
Contributions are welcome! Please see CONTRIBUTING.md for more details.
Let me know if you need further adjustments!