Skip to content
Snippets Groups Projects
Commit ba63508e authored by 민재 조's avatar 민재 조
Browse files

full stack complete

parent 93a608b3
No related branches found
No related tags found
No related merge requests found
...@@ -2,11 +2,13 @@ package kr.ajou.prcoding.mySpringWeb.controller; ...@@ -2,11 +2,13 @@ package kr.ajou.prcoding.mySpringWeb.controller;
import java.util.List; import java.util.List;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import kr.ajou.prcoding.mySpringWeb.dto.FavoriteMusicRequestDto; import kr.ajou.prcoding.mySpringWeb.dto.FavoriteMusicRequestDto;
...@@ -15,6 +17,7 @@ import kr.ajou.prcoding.mySpringWeb.entity.FavoriteMusic; ...@@ -15,6 +17,7 @@ import kr.ajou.prcoding.mySpringWeb.entity.FavoriteMusic;
import kr.ajou.prcoding.mySpringWeb.service.MusicService; import kr.ajou.prcoding.mySpringWeb.service.MusicService;
@RestController @RestController
@CrossOrigin(origins = "http://localhost:3000") // npm start로 테스트하기 위해 넣음.
public class MyWebController { public class MyWebController {
@Autowired @Autowired
......
...@@ -38,6 +38,7 @@ public class MusicService { ...@@ -38,6 +38,7 @@ public class MusicService {
public List<FavoriteMusic> getLikes(){ public List<FavoriteMusic> getLikes(){
try{ try{
System.out.println("Trying to getLikes!");
return albumsRepo.findAll(); return albumsRepo.findAll();
} catch (Exception e){ } catch (Exception e){
System.out.println(e.toString()); System.out.println(e.toString());
......
This diff is collapsed.
<!doctype html>
<html>
<head>
<title> muiBasic </title>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
</head>
<body>
<div id="app"></div>
<script src="./app.bundle.js" type="text/javascript"></script>
</body>
</html>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment