-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade the erlang-server dependency from cowboy1.x to cowboy2.x #1364
Conversation
@feihongmeilian thanks for the PR. cc @tsloughter (2017/11) @jfacorro (2018/10) @robertoaloi (2018/10) (technical committee), |
Can you please uncomment the following line to see if the CI tests pass? Line 1226 in 8f61ace
|
The Erlang petstore server builds without issue. If no further feedback from anyone, I'll merge it into 4.0.x on coming Wed. (4.0.0 will be released on Dec 20th) |
@feihongmeilian thanks for the contribution, which has been included in the 4.0.0-beta release: https://twitter.com/oas_generator/status/1079727020374806529. Happy New Year and looking forward to more collaboration and contributions in 2019! |
…enAPITools#1364) * Upgrade the erlang-server dependency from cowboy1.x to cowboy2.x * Update erlang-server sample * Fix a bug for erlang-server test
Use erlang-server with erlang.mk
1, Create an application by using erlang.mk
$ mkdir http_server
$ cd http_server
$ wget https://erlang.mk/erlang.mk
$ make -f erlang.mk bootstrap bootstrap-rel
$ make run
2, Modify the Makefile in the http_server directory to the following to introduce the dependency library:
PROJECT = http_server
PROJECT_DESCRIPTION = New project
PROJECT_VERSION = 0.1.0
3,Generate erlang-server project using openapi-generator
https://github.com/OpenAPITools/openapi-generator#2---getting-started
4, Copy erlang-server file to http_server project
5,Start in the http_server project:
1,Introduce the following line in the start(_Type, _Args) function
openapi_server:start(http_server, #{ip=>{127,0,0,1}, port=>8080, net_opts=>[]}),
2,Compilation http_server project
$ make
3,Start erlang virtual machine
$erl -pa ./deps/cowboy/ebin -pa ./deps/cowlib/ebin -pa ./deps/ranch/ebin -pa ./deps/jsx/ebin -pa ./deps/jesse/ebin -pa ./deps/rfc3339/ebin -pa ./ebin
4, Start project
application:ensure_all_started(http_server).