LoginSignup
0
0

More than 5 years have passed since last update.

docker の mongodb イメージを導入して spring-boot から接続する

Last updated at Posted at 2017-08-20

# mongodb の image をダウンロード
$ docker pull mongo

# mondodb を起動
$ docker run -p 27017:27017 -d mongo

# spring-boot のサンプルをクローン
$ git clone https://github.com/dinukadev/justiceleague_management_system/tree/master/src/main/java/com/justiceleague/justiceleaguemodule

$ cd justiceleaguemodule

# ビルド
$ mvn clean install

# 実行
$ java -jar target/justiceleaguemodule-0.0.1-SNAPSHOT.jar

# API確認
$ curl -H "Content-Type: application/json" -X POST -d '{"name":"Hatimiti","superPower":"super speed","location":"Central City"}' http://localhost:8080/justiceleague/addMember

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0