新建項(xiàng)目
創(chuàng)建流程
new->project
image.png
-
我們是web項(xiàng)目妆够,配置springweb
image.png
創(chuàng)建完畢
這個(gè)就是我們新建好的項(xiàng)目
image.png
創(chuàng)建一個(gè)接口
我們創(chuàng)建個(gè)接口試一下
image.png
image.png
image.png
把代碼復(fù)制進(jìn)去
package com.mi.mallserver;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class TestController {
@GetMapping("/")
public String get(){
return "mallServer TestController.get success";
}
}
image.png
啟動(dòng)
點(diǎn)擊
image.png
啟動(dòng)完成
image.png
打開(kāi)瀏覽器,輸入
http://localhost:8080/
image.png
到這里就代表我們項(xiàng)目啟動(dòng)成功永脓,并成功返回我們想要的數(shù)據(jù)。