# Implement a REST server in Julia?

**URL:** <https://discourse.julialang.org/t/implement-a-rest-server-in-julia/9117>\
**Category:** Web Stack\
**Created:** [February 16, 2018, 6:55pm UTC](https://discourse.julialang.org/t/implement-a-rest-server-in-julia/9117 "2018-02-16T18:55:37Z")\
**Posts on this page:** 1\
**Showing post:** 19

<div class="post-metadata">

**Author:** ![Alexander-Barth](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alexander-barth/32/3692_2.png) [@Alexander-Barth](https://discourse.julialang.org/u/Alexander-Barth)\
**Post date:** [October 14, 2022, 7:56pm UTC](https://discourse.julialang.org/t/implement-a-rest-server-in-julia/9117/19 "2022-10-14T19:56:30Z")

</div>

Indeed, Oxygen.jl handels this case very well ! And the interface looks very lightweight and pleasant to use.

(for reference here is my test code: a call to e.g. /long/1 does not block a call to /short/1 )

```julia
# julia is started with
# julia -t4

using Oxygen, Dates, HTTP

function long(a)
    t = Dates.now() + Dates.Minute(1)

    while (t > Dates.now())
        a = a+1
    end
    return a
end

@get "/long/{a}" function(req::HTTP.Request,a::Int)
    @info "long"
    return Dict("value" => long(a))
end

@get "/short/{a}" function(req::HTTP.Request,a::Int)
    @info "short"
    return Dict("value" => a)
end

serveparallel()

```

---

_[View the full topic](https://discourse.julialang.org/t/implement-a-rest-server-in-julia/9117)._
