A simple mock server built with Node.js and Express.
HTTP request | Description | Notes |
---|---|---|
POST /mirror/ | Returns the request body as a response. | |
GET /status/{status} | Returns a response with the specified http status code. |
Parameter | Type | Description |
---|---|---|
delay | Number | Delays the response by the specified value in milliseconds. |
-
Clone this repository:
git clone https://github.com/ryo8000/simple-mock-server.git cd simple-mock-server
-
Build and run the application in a Docker container:
docker build -t simple-mock-server . docker run -p 8000:8000 simple-mock-server
-
Clone this repository:
git clone https://github.com/ryo8000/simple-mock-server.git cd simple-mock-server
-
Install dependencies using Yarn:
yarn install
-
Build the application:
yarn build
-
Run the application:
node dist/app.js
Name | Description | Required | Default Value |
---|---|---|---|
ORIGIN | The value of the Access-Control-Allow-Origin response header | No | * |
PORT | Port number for this application | No | 8000 |
For developer-specific instructions, including details on testing and project structure, see the Development Guide.
This project is licensed under the MIT License.