# Live reload API

**URL:** <https://discourse.julialang.org/t/live-reload-api/61908>\
**Category:** General Usage\
**Tags:** web, http\
**Created:** [May 27, 2021, 9:14am UTC](https://discourse.julialang.org/t/live-reload-api/61908 "2021-05-27T09:14:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Skoffer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/skoffer/32/378_2.png) [@Skoffer](https://discourse.julialang.org/u/Skoffer)\
**Post date:** [May 27, 2021, 9:14am UTC](https://discourse.julialang.org/t/live-reload-api/61908/1 "2021-05-27T09:14:32Z")

</div>

I wonder is there any mechanism to implement live reload in case one develops REST API?

As an example, consider the following code, which is defined in file “server.jl”

```julia
using HTTP

function hello(r)
    return HTTP.Response(200, "Hello")
end

const ROUTER = HTTP.Router()

HTTP.@register(ROUTER, "GET", "", hello)

HTTP.serve(ROUTER)

```

Now, if I start this server with `julia server.jl`, then in shell I can get

```shell
sh> curl localhost:8081
Hello%

```

So, if I want to make changes to the function `hello`, is it possible to get new version of this function without restarting the server?

I’ve seen [[ANN] LiveServer: A simple development server with live-reload capability](https://discourse.julialang.org/t/ann-liveserver-a-simple-development-server-with-live-reload-capability/23380), but as far as I understood it is more suitable for static HTML, or I wasn’t able to figure out, how to bend it for my usecase.

I do not mind any sort of hacks (and Revise is totally fine of course) as long as they work.

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [May 27, 2021, 9:19am UTC](https://discourse.julialang.org/t/live-reload-api/61908/2 "2021-05-27T09:19:12Z")

</div>

There is some discussion and examples in this issue: [HTTP.jl#587](https://github.com/JuliaWeb/HTTP.jl/issues/587).

---

<div class="post-metadata">

**Author:** ![Skoffer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/skoffer/32/378_2.png) [@Skoffer](https://discourse.julialang.org/u/Skoffer)\
**Post date:** [May 27, 2021, 9:46am UTC](https://discourse.julialang.org/t/live-reload-api/61908/3 "2021-05-27T09:46:26Z")

</div>

Awesome, this comment [https://github.com/JuliaWeb/HTTP.jl/issues/587#issuecomment-730197706](https://github.com/JuliaWeb/HTTP.jl/issues/587#issuecomment-730197706) worked without any issues.

It would be nice to document it somehow, though even in my case it required small changes to work properly, so it’s hard to say what is the proper documentation.
