Giter VIP home page Giter VIP logo

Comments (4)

vrkansagara avatar vrkansagara commented on June 3, 2024

After reloading the new bootstrap, I still had the same issue.
image

from genie.jl.

PGimenez avatar PGimenez commented on June 3, 2024

I'm not sure I completely understand the issue, but I've tried reproducing the hot-reload after an error problem and hot reloading works fine for me. What I've done:

  • Start with this code and access the /path
using Genie
using Genie.Renderer.Html

route("/") do
    "Welcome"
end
#= route("/error") do =#
#=     html("Error?") =#
#= end =#
  • Uncomment the second route and access /error. This throws a html not defined error
  • Add using Genie.Renderer.Htmlto the top of the script and try /error again. This time it works

Is this what you're trying to do?

from genie.jl.

PGimenez avatar PGimenez commented on June 3, 2024

There's another thing, which I'm not sure you're doing to trigger an error on purpose. The route takes a function as first argument, not a rendered HTML string as the one returned y html(). With the do...end syntax we're passing an anonymous function to it. You can see the signatures here

julia> methods(route)
# 3 methods for generic function "route" from Genie.Router:
 [1] route(action::Function, path::String; method, named, context)
     @ ~/.julia/packages/Genie/Es7Db/src/Router.jl:236
 [2] route(path::String, action::Function; method, named, context)
     @ ~/.julia/packages/Genie/Es7Db/src/Router.jl:239
 [3] route(r::Genie.Router.Route)
     @ ~/.julia/packages/Genie/Es7Db/src/Router.jl:242

This is how you'd use it with a function parameter

using Genie
greet() = "Welcome to Genie!"
route("/greet", greet)          # [GET] /greet => greet
up() # start the server

from genie.jl.

vrkansagara avatar vrkansagara commented on June 3, 2024

This is not happening with MVC framework that I can confirm.

from genie.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.