Spring启动和RAML

问题描述 投票:1回答:1

我试图建立并运行这个项目https://github.com/adorsys/raml-springboot-example

我在右键单击和Maven安装时构建项目。那时raml-springboot-impl.jar不会在raml-springboot-impl项目下生成。你对此有任何想法吗?

maven spring-boot raml
1个回答
1
投票

尝试在终端/ bash中键入或复制+粘贴以下命令,如git repos README.md中所示:

(我将从Mac发布我的示例,你可能必须明智地修改它)

  • cd到repo-s root:

cd /Users/username/Documents/RAML/raml-springboot-example

  • 生成包:

mvn clean package

  • 运行项目:

java -jar raml-springboot-impl/target/raml-springboot-impl.jar

  • 创建一个新的Todo:

curl -i -X POST -H 'Content-Type: application/json' -d '{ "task": "Design the API", "priority": 1 }' localhost:8080/api/todos

  • 列出所有Todos

curl -i -H 'Accept: application/json' localhost:8080/api/todos

  • 通过id获取一个Todo

curl -i -H 'Accept: application/json' localhost:8080/api/todos/1

如果您在浏览器中看到内容时感觉更舒服,可以将最后两个链接粘贴到Chrome或您正在使用的任何内容;)

此外,您可以尝试使用https://www.getpostman.com/来测试接受“GET”请求之外的端点(如此处的第一个请求);)

© www.soinside.com 2019 - 2024. All rights reserved.