An example project showcasing how to build a secure REST API with Speedment and Spring Boot.
Java
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src Upload project Jan 30, 2017
.gitignore Upload project Jan 30, 2017
LICENSE Initial commit Jan 30, 2017
README.md Update README.md Jan 30, 2017
pom.xml Upload project Jan 30, 2017

README.md

Speedment Secure REST Example

An example project showcasing how to build a secure REST API with Speedment and Spring Boot.

Usage

Clone the project and build it using Maven.

Set up the database using this SQL code:

create database `securerest`;
use `securerest`;

create table `account` (
    `id` bigint not null auto_increment primary key,
    `username` varchar(30) not null unique,
    `password` char(60) not null,
    `role` enum('USER', 'ADMIN') not null
);

Configure the MySQL username and password in the application.properties-file in case you don't use "root" and "password" as credentials.

Start the application. The following endpoints will be mapped:

  • POST /account
  • GET /account
  • GET /account/{id}

Here are some example cURL-commands that you can try:

Register an Account
curl -X POST "http://localhost:9777/account
    ?username=my_user
    &password=my_pass"
See Information About User #1
curl -X  GET -u my_user:my_pass "http://localhost:9777/account/1"
See Information About All Users
curl -X  GET -u my_user:my_pass "http://localhost:9777/account"