Giter Club home page Giter Club logo

musicalbums.jl's Issues

HTTP.@register macro is removed, handler is not defined

Thanks for the tutorial! It seems that in the last three years the @register macro has been removed and replaced with a function named register!. Docs at

https://juliaweb.github.io/HTTP.jl/v0.6/index.html#HTTP.Handlers.register!

This seems to fix any syntax errors to use the module in dev mode and start a server.

Now creating an object through the client module fails with the following exception.

julia> alb1 = Client.createAlbum("Free Yourself Up", "Lake Street Dive", 2018, ["Baby Don't Leave Me Alone With My Thoughts", "Good Kisser"])
┌ Error: handle_connection handler error
│   exception =
│    UndefVarError: handle not defined
│    Stacktrace:
│     [1] requestHandler(req::HTTP.Messages.Request)
│       @ MusicAlbums.Resource ~/src/julia-tutorials/microservices/MusicAlbums.jl/src/Resource.jl:25
│     [2] (::HTTP.Handlers.var"#1#2"{typeof(MusicAlbums.Resource.requestHandler)})(stream::HTTP.Streams.Stream{HTTP.Messages.Request, HTTP.ConnectionPool.Connection})
│       @ HTTP.Handlers ~/.julia/packages/HTTP/kkBAx/src/Handlers.jl:58
│     [3] #invokelatest#2
│       @ ./essentials.jl:729 [inlined]
│     [4] invokelatest
│       @ ./essentials.jl:726 [inlined]
│     [5] handle_connection(f::Function, c::HTTP.ConnectionPool.Connection, listener::HTTP.Servers.Listener{Nothing, Sockets.TCPServer}, readtimeout::Int64, access_log::Nothing)
│       @ HTTP.Servers ~/.julia/packages/HTTP/kkBAx/src/Servers.jl:447
│     [6] (::HTTP.Servers.var"#16#17"{HTTP.Handlers.var"#1#2"{typeof(MusicAlbums.Resource.requestHandler)}, HTTP.Servers.Listener{Nothing, Sockets.TCPServer}, Set{HTTP.ConnectionPool.Connection}, Int64, Nothing, Base.Semaphore, HTTP.ConnectionPool.Connection})()
│       @ HTTP.Servers ./task.jl:484
└ @ HTTP.Servers ~/.julia/packages/HTTP/kkBAx/src/Servers.jl:461
ERROR: HTTP.Exceptions.StatusError(500, "POST", "/album", HTTP.Messages.Response:
"""
HTTP/1.1 500 Internal Server Error
Transfer-Encoding: chunked

UndefVarError: handle not defined""")

Julia 1.8.3 on Ubuntu Linux

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.