Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arjundandagi/topic-application
https://github.com/arjundandagi/topic-application
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/arjundandagi/topic-application
- Owner: ArjunDandagi
- Created: 2020-09-30T06:16:46.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-09-29T14:42:17.000Z (over 3 years ago)
- Last Synced: 2023-03-10T22:18:42.524Z (almost 2 years ago)
- Language: Java
- Size: 65.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SpringBoot with JPA MYSQL
sample spring boot app to understand directory structer
and creating an app with mysql as the database backend## Initial Setup
run a mysql server on your host ( use a container otherwise)
```bash
mysql> create database topics; -- Creates the new database
mysql> create user 'springuser'@'%' identified by 'ThePassword'; -- Creates the user
mysql> grant all on topics.* to 'springuser'@'%'; -- Gives all privileges to the new user on the newly created
```now you are all set to run this application
## USAGE
```
git clone https://github.com/ArjunDandagi/topic-application
cd topic-application
mvn clean install # you can just download dependency also using mvn dependency:resolve
mvn spring-boot:run```
now go to `http://localhost:8080/hello` to make sure app is good
#CRUD
## CREATE
> curl -H "Content-type: Application/json" -X POST http://localhost:8080/topics -d '{"id":"java","name":"java","description":"java is awesome"}'
>## GET
> curl -H "Content-type: Application/json" -X GET http://localhost:8080/topics## GET BY ID
> curl -H "Content-type: Application/json" -X GET http://localhost:8080/topics/java
>
if you ask for a topic whose id doesn't exist . it will throw an error :smile:## Update A Topic
> curl -H "Content-type: Application/json" -X PUT http://localhost:8080/topics/java -d '{"id":"java","name":"java","description":"java and maven is awesome"}'
## Delete A Topic
> curl -H "Content-type: Application/json" -X DELETE http://localhost:8080/topics/java