본문 바로가기

원도우

[원도우] spring boot 프로젝트 생성 및 실행

반응형

spring boot 프로젝트 생성 및 실행

java(jdk) 설치 : https://scbyun.com/1441

vscode 환경 설정 : https://sangchul.kr/552

spring boot 프로젝트 생성

DemoApplicaion.java

package com.example.demo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class DemoApplication {

	public static void main(String[] args) {
		SpringApplication.run(DemoApplication.class, args);
	}

}

DemoApplication.java 편집

cd demo\src\main\java\com\example\demo

package com.example.demo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
public class DemoApplication {

	@RequestMapping("/")
	String home() {
		return "Hello World!";
	}
	public static void main(String[] args) {
		SpringApplication.run(DemoApplication.class, args);
	}

}

728x90
반응형