- Clone or download the repository
- Open the project in your favorite IDE (e.q. Intellij Idea)
- The service does not use an external database. It's based on files. By default the service will write texts under default
texts
directory located in the root of the project. If you want to change it then define the jvm arg:-Dtexts.folder=PATH_TO_YOUR_FOLDER
- Run spring-boot
test.maksim.editor.ws.Application
class oftext-editor-ws
module. The service will be running on port8080
- Clone or download the repository
- Build the project using `mvn clean package'
- The service does not use an external database. It's based on files. By default the service will write texts under default
texts
directory located in the root of the project. If you want to change it then define the jvm arg:--texts.folder=PATH_TO_YOUR_FOLDER
- Start the service:
java -jar text-editor-ws/target/text-editor-ws-1.0-SNAPSHOT.jar
. Or with custom text folder:java -jar text-editor-ws/target/text-editor-ws-1.0-SNAPSHOT.jar --texts.folder=PATH_TO_YOUR_FOLDER
- Open swagger-api ui:
http://localhost:8080/swagger-ui.html
- Here you can see all available endpoints and models and try to execute examples.
If you need to use the service from another java program, you can use client provided by the service. The usage is pretty simple. Just build and import maven module text-editor-client
. If your service is using Spring you need to import the module in your configuration: @Import(TextEditorClientConfig.class)
and override the service base url if necessary: -Dtext-editor.service.base.url=YOUR_SERVICE_URL
. If you use plain java program you can create the client by your self. See a usage example in test.maksim.editor.client.TextEditorClientUsage
. Also using the example you can try how the service works. Just open it in your IDEA and run main
method (Note: the service should be running).
- Add requests validation
- Add errors handling
- Change responses. For example,
addLines
endpoint can return statuses of operations instead ofvoid
. Also need to handle case when text is not found.