Skip to content

Latest commit

 

History

History
35 lines (28 loc) · 1.54 KB

README.md

File metadata and controls

35 lines (28 loc) · 1.54 KB

Spring + JWT + MariaDB

🌍 Click here for a Portuguese(Brazil) version.

I made this repo to study, so it should have errors or better ways to do some stuff. Feel free to open a Pull Request or create Issues.

Technologies used

How to run

  • Just compile it using: mvn clean install;
  • Copy your file from target/springus-1.0.0-SNAPSHOT.jar to a nice place;
  • Execute these queries in your database:
    INSERT INTO roles(name) VALUES('ROLE_USER');
    INSERT INTO roles(name) VALUES('ROLE_ADMIN');
    
  • And run using java (PUT YOUR ENV VARIABLES HERE) -jar springus-1.0.0-SNAPSHOT.jar.

Environment Variables

  • spring.datasource.url: Your JDBC url.
    • Ex: -Dspring.datasource.url=jdbc:mariadb://localhost:3306/springus
  • spring.datasource.username: Your database username.
    • Ex: -Dspring.datasource.username=lucasmellof
  • spring.datasource.password=supersecretpassword: Your database password.
    • Ex: -Dspring.datasource.password=super
  • springus.jwt_secret: Your JWT secret token.
    • Ex: -Dspringus.jwt_secret=supersecretjwttoken
  • springus.jwt_expiration_time: JWT token expiration time (in seconds).
    • Ex: -Dspringus.jwt_expiration_time=900000