2

GitHub - januschung/mock

 1 year ago
source link: https://github.com/januschung/mock
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Introduction

This is a simple REST mock server written with Java Spring Boot 3.0.1 and Java 17.

It provides sample endpoints to render output either based on static resource file or simple logic as defined in the service classes.

The server can either be brought up as a standalone jar application or as a docker.

Feel free to provide feedback or feature request.

Customize the Mock Service

I tried to keep it simple with the controller and service class implementation so that one can easily modify the endpoint name, parameter, service logic as well as the return response from the static file.

Available Endpoints:

/resource?data=[value]/status?code=[value]/delay?code=[value]

Build and run

mvn clean install
java -jar target/tnite-mock-1.0-SNAPSHOT.jar

Build and run with docker

mvn clean install && docker build -t tnite-mock:latest .
docker run -p 9090:9090 tnite-mock:latest

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK