小熊派開發板實踐:智慧路燈沙箱實驗之真實裝置接入
阿新 • • 發佈:2020-11-05
- 1.檔案——>新建
- 2.選擇Spring Initializr,然後選擇next
- 3.填寫專案相關的資訊
- 4
- 5
- 6 建立web包,並建立一個類IndexController
- 7.IndexController程式碼:
package com.springboot.web; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.ResponseBody; @Controller public class IndexController { @RequestMapping(value = "/say") public @ResponseBody String say(){ return "hello,springboot"; } }
- 8.執行
- 10訪問以及結果
http://127.0.0.1/8080/say