Skip to content
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

Merged
merged 3 commits into from
Nov 28, 2018
Merged

Upgrade the erlang-server dependency from cowboy1.x to cowboy2.x #1364

merged 3 commits into from
Nov 28, 2018

Conversation

feihongmeilian
Copy link
Contributor

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

DEPS = cowboy jesse jsx
dep_cowboy_commit = 2.5.0
dep_jesse_commit = 1.5.2
dep_jsx_commit = 2.9.0
DEP_PLUGINS = cowboy jesse jsx

PACKAGES += rfc3339
pkg_rfc3339_name = rfc3339
pkg_rfc3339_description = an erlang/elixir rfc3339 lib
pkg_rfc3339_homepage = https://github.com/talentdeficit/rfc3339
pkg_rfc3339_fetch = git
pkg_rfc3339_repo = https://github.com/talentdeficit/rfc3339
pkg_rfc3339_commit = master

 include erlang.mk

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).

@wing328
Copy link
Member

wing328 commented Nov 5, 2018

@feihongmeilian thanks for the PR.

cc @tsloughter (2017/11) @jfacorro (2018/10) @robertoaloi (2018/10) (technical committee),
@galaxie (author of the Erlang server generator)

@wing328
Copy link
Member

wing328 commented Nov 6, 2018

Can you please uncomment the following line to see if the CI tests pass?

<module>samples/server/petstore/erlang-server</module> -->

@wing328 wing328 modified the milestones: 3.3.3, 3.3.4 Nov 14, 2018
@wing328
Copy link
Member

wing328 commented Nov 25, 2018

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)

@wing328 wing328 changed the base branch from master to 4.0.x November 25, 2018 14:13
@wing328 wing328 merged commit 5b4a198 into OpenAPITools:4.0.x Nov 28, 2018
@wing328 wing328 modified the milestones: 3.3.4, 4.0.0 Nov 30, 2018
@wing328
Copy link
Member

wing328 commented Jan 2, 2019

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants