Spring Boot RESTful API for user creation
To compile and run the project, just use the command
spring-boot:run
.
Email and Password validation regular expressions can be configured in the
application.yml
file in thevalidation.email
andvalidation.password
properties. The respective error messages can be configured in themessages.properties
file in theemail.message
andpassword.message
properties.
The project uses H2 in-memory database, and does not need a build script.
- Create User: POST http://localhost:8080/api/users
{
"name": "Juan Rodriguez",
"email": "[email protected]",
"password": "hunter2A%",
"phones": [
{
"number": "1234567",
"citycode": "1",
"contrycode": "57"
}
]
}
-
Get All Users: GET http://localhost:8080/api/users
-
Get User by id: GET http://localhost:8080/api/users/{id}
-
Update User by id: PUT http://localhost:8080/api/users/{id}
{
"name": "Juan Rodriguez Perez",
"email": "[email protected]",
"password": "hunter2A%#",
"phones": [
{
"number": "123456788",
"cityCode": "1",
"countryCode": "57"
},
{
"number": "535435435",
"cityCode": "2",
"countryCode": "57"
}
]
}
- Delete User: DELETE http://localhost:8080/api/users/{id}