From: Nuku A. <na...@st...> - 2016-09-05 17:26:00
|
sorry if i complicated things . > Continuing this example, is this what the directory structure should > look like? > (test is my OTP application). > > test > ├── src > ├── test > ├── ebin > ... yes this is how the directory structure of an otp application is like but there could be addition folders like test (for tests), priv (for executables,other file,folders which your app needs), doc(for documentation) include(for header files) > yapps > ├── src > ├── test > ├── ebin > ... there is no need for creating a yapps app since the yapp application has already been created and is part of the yaws distribution . you have to however add the ebin path for the yapp path in your yaws.conf file eg. ebin_dir = /yaws/yaws-2.0.3/applications/yapp/ebin > test > ├── src > ├── test > ├── ebin > yapp apps are otp application with the priv folder containing a docroot folder containing your yaws webpages,css,js etc... so you will need a priv folder added to the above . you also have to add a path to your test application and its other sub applications in the yaws.conf file your test.app file below {application, test, [{description,"Yap Test"}, {vsn,"0.1.0"}, {modules,[mone,mtwo,mthre]}, {env, []}, {registered, []}, {applications,[kernel, stdlib, yaws, yapp,test1,test2]}]}. your yaws.conf should include the ff to start your yapp application runmod = yapp ebin_dir = /yaws/yaws-2.0.3/applications/yapp/ebin ebin_dir = /path_to_test/ebin ebin_dir = /path_to_test1/ebin ebin_dir = /path_to_test2/ebin > ###yap server <server test> port = 8004 listen = 127.0.0.1 docroot = /var/www/ dir_listings = false arg_rewrite_mod = yapp <opaque> yapp_server_id = internal bootstrap_yapps = test </opaque> </server> to access your yapp , start yaws and your yapp otp application will be started for building otp applications check out http://learnyousomeerlang.com/building-otp-applications the whole book is actually very good if you are learning erlang . On Monday, September 5, 2016 1:41 PM, Mark Bucciarelli <mk...@gm...> wrote: > On Mon, Sep 5, 2016 at 2:19 AM, Nuku Ameyibor <na...@st...> wrote: >> > > > > yapps is an otp application so you can package your gen server as > an otp > > application and have it as one of the applications your yapp app > will start > > before it starts itself. > > > > This is the first time I am setting up an Erlang application and > eventually > release, so my questions are pretty basic. > > Continuing this example, is this what the directory structure should > look like? > (test is my OTP application). > > test > ├── src > ├── test > ├── ebin > ... > yapps > ├── src > ├── test > ├── ebin > ... > > Then, to start up the yapp, I could do this? > > $ erl -env ERL_LIBS "." > 1> application:load(test). > ok > 2> application:start(yapps). > ok > > > Does the entire yaws source tree go under the yapps directory? > > Eventually, I will have multiple apps (test1, test2, etc) referenced > in the > yapps "applications" property and will want to package the entire set > as a > release. > > Thanks, > > Mark > > -- > Blogging at markbucciarelli.com <http://markbucciarelli.com> > Tweeting @mbucc |