This application provides a REST interface that allows CRUD and search functionality on text entities. This is meant to be used for the front-end coding assignment.
- Java 1.8 Runtime
- Maven
- Browse to the root project containing the
pom.xml
file - Start the server by executing
mvn spring-boot:run
When the server started successfully, you should see the following message:
Tomcat started on port(s): 8080 (http)
You should also be able to request http://localhost:8080/text
- Create a new text:
Send a POST request to http://localhost:8080/text with, for example, the following body
{
"title": "Test title",
"content": "Test Content",
"score": 4
}
- Update an existing text:
Send a PUT request to http://localhost:8080/text with, for example, the following body
{
"id": "AVNVk1Ebt4z2On7hAeGI",
"title": "Test modified title",
"content": "Some modified text",
"score": 10
}
- List all texts:
Send a GET request to http://localhost:8080/text
- Find one text:
Send a GET request to http://localhost:8080/text/[ID]. For example in the previous test, you'd request http://localhost:8080/text/AVNVk1Ebt4z2On7hAeGI
- Remove an existing text:
Send a DELETE request to http://localhost:8080/text/[ID]. For example in the previous test, you'd request http://localhost:8080/text/AVNVk1Ebt4z2On7hAeGI
- Request a basic fuzzy search (
analyze_wildcard
set totrue
) on the texts (content and title):
Send a GET request to http://localhost:8080/text/search/ome+odifie+ex/. Mind the trailing slash.