Skip to content

Commit 482a63e

Browse files
author
Rajeev Kumar Singh
committed
Readme and Test
1 parent 55fd14d commit 482a63e

File tree

2 files changed

+69
-2
lines changed

2 files changed

+69
-2
lines changed

Readme.md

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Spring Boot, MongoDB, Angular-4 Restful API Tutorial
2+
3+
Build Restful CRUD API for a simple Note-Taking application using Spring Boot, Mysql, JPA and Hibernate.
4+
5+
## Requirements
6+
7+
1. Java - 1.8.x
8+
9+
2. Maven - 3.x.x
10+
11+
3. Mysql - 5.x.x
12+
13+
## Steps to Setup
14+
15+
**1. Clone the application**
16+
17+
```bash
18+
git@github.com:callicoder/spring-boot-mysql-rest-api-tutorial.git
19+
```
20+
21+
**2. Create Mysql database**
22+
```bash
23+
create database notes_app
24+
```
25+
26+
**3. Change mysql username and password as per your installation**
27+
28+
+ open src/main/resources/application.properties
29+
30+
+ change `spring.datasource.username` and `spring.datasource.password` as per your mysql installation
31+
32+
**2. Build and run the app using maven**
33+
34+
```bash
35+
mvn package
36+
java -jar target/easy-notes-1.0.0.jar
37+
```
38+
39+
Alternatively, you can run the app without packaging it using -
40+
41+
```bash
42+
mvn spring-boot:run
43+
```
44+
45+
The app will start running at <http://localhost:8080>.
46+
47+
## Explore Rest APIs
48+
49+
The app defines following CRUD APIs.
50+
51+
GET /api/notes
52+
53+
POST /api/notes
54+
55+
GET /api/notes/{noteId}
56+
57+
PUT /api/notes/{noteId}
58+
59+
DELETE /api/notes/{noteId}
60+
61+
You can test them using postman or any other rest client.
62+
63+
## Learn more
64+
65+
You can find the tutorial for this application on my blog -
66+
67+
<https://www.callicoder.com/spring-boot-rest-api-tutorial-with-mysql-jpa-hibernate/>

src/test/java/com/example/SpringBootMysqlRestApiTutorialApplicationTests.java src/test/java/com/example/easynotes/EasyNotesApplicationTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.example;
1+
package com.example.easynotes;
22

33
import org.junit.Test;
44
import org.junit.runner.RunWith;
@@ -7,7 +7,7 @@
77

88
@RunWith(SpringRunner.class)
99
@SpringBootTest
10-
public class SpringBootMysqlRestApiTutorialApplicationTests {
10+
public class EasyNotesApplicationTests {
1111

1212
@Test
1313
public void contextLoads() {

0 commit comments

Comments
 (0)