novaframework / rebar3_nova Goto Github PK
View Code? Open in Web Editor NEWThis is a rebar3 plugin for nova.
License: Apache License 2.0
This is a rebar3 plugin for nova.
License: Apache License 2.0
Today we actually have structure defined in a nova-plugin to return information such as options, intent etc. The problem is that this information is not viewable other than in code.
We should build a function so that one can actually get the information outputted into human-readable text.
Relates to this ticket in Nova novaframework/nova#116
Create a new plugin (In the nova namespace) that can list all the routes within a system. Phoenix is doing this with mix phx.routes
and is quite useful.
Blocked by novaframework/nova#85
I think it would be a lot more intuitive to understand and use nova if it could come with a template with the basic CRUD operations over a given domain model , so that the user could see how can he define the different exposed methods using either querystring or json.
Ideally the template could also contain the code to decode (using a serializer) and fetch some fields of the json
and also the code in order to encode back and send the json response.
The template could include a controller with the methods
-module(pet_controller).
-export([get/1, create/1, delete/1,update/1]).
get(Req=#{bindings := #{<<"id">> := Id}})->
.....
Pet= fetch_pet_from_somewhere(Id),
Encode= thoas:encode(Pet),
{json,200,#{},Encode}.
get(Req=#{parsed_qs:= #{<<"id">> := Id}})->
.....
Pet= fetch_pet_from_somewhere(Id),
Encode= thoas:encode(Pet),
{json,200,#{},Encode}.
create(Req=#{json := { <<"id">> := Id , <<"hair_color">> := HairColor } })->
insert_to_db(Req),
{json,200,#{},<<"created">>}.
update(Req=#{json := { <<"id">> := Id , <<"hair_color">> := HairColor } })->
update_to_db(Req),
{json,200,#{},<<"updated">>}.
delete(Req=#{parsed_qs:= { <<"id">> := Id } })->
delete(Req),
{json,200,#{},<<"deleted">>}.
The datalayer could just be a mock or another module with undefined methods or just some constant in the method , it doesn't rlly matter but the important part is for the new user to see how he handles json/binding/querystring, serialization,deserialization , json deconstruction (fetching particular fields)
And ideally this template could just be started and checked out with swagger.
P.S The idea came from C# where there are a couple of web api templates pic related
Originally posted by @sanzor in novaframework/nova#217
After update with flatlog and we create a release that we try to start we get this error:
Exec: /usr/local/lib/erlang/erts-12.0/bin/erlexec -boot /home/daniel/project/test/_build/default/rel/test/releases/0.1.0/start -mode embedded -boot_var SYSTEM_LIB_DIR /usr/local/lib/erlang/lib -config /home/daniel/project/test/_build/default/rel/test/releases/0.1.0/sys.config -args_file /home/daniel/project/test/_build/default/rel/test/releases/0.1.0/vm.args -- console
Root: /home/daniel/project/test/_build/default/rel/test
/home/daniel/project/test/_build/default/rel/test
{"could not start kernel pid",application_controller,"invalid config data: application: kernel; invalid parameter: #{formatter =>\n {flatlog,#{colored => true,map_depth => 3,\n template =>\n [colored_start,\"[\e[1m\",level,\"\e[0m\",colored_start,\n \"] [\",time,\"]\",colored_end,\" \",msg,\" (\",mfa,\")\n\"],\n term_depth => 50}}}"}
could not start kernel pid (application_controller) (invalid config data: application: kernel; invalid parameter: #{formatter =>
{flatlog,#{colored => true,map_depth => 3,
temp
rebar3 new nova_plugin mynewplugin
===> Writing src/Plugin name.erl
Should be src/mynewplugin.erl
We should add a favicon to html templating for a new repo.
Now we get a 404 on favicon when we template a new repo and point the browser to the start page.
We have done some changes in templating and need to update the plugin.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.