# \[ANN\] Mongoose.jl - Build simple web servers

**URL:** <https://discourse.julialang.org/t/ann-mongoose-jl-build-simple-web-servers/131117>\
**Category:** Package Announcements\
**Tags:** package, announcement, web\
**Created:** [July 28, 2025, 12:18am UTC](https://discourse.julialang.org/t/ann-mongoose-jl-build-simple-web-servers/131117 "2025-07-28T00:18:32Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![AbrJA](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abrja/32/207387_2.png) [@AbrJA](https://discourse.julialang.org/u/AbrJA)\
**Post date:** [July 28, 2025, 12:18am UTC](https://discourse.julialang.org/t/ann-mongoose-jl-build-simple-web-servers/131117/1 "2025-07-28T00:18:33Z")

</div>

Hi there,

I just want to share this new package [Mongoose.jl](https://github.com/AbrJA/Mongoose.jl) I developed as a personal project to dig in into Julia, it can be used to build simple web apps. It is build on top of [mongoose c library](https://github.com/cesanta/mongoose).

Developing an API rest is a simple as:

```julia-auto
using Mongoose

function greet(conn; kwargs...)
    mg_json_reply(conn, 200, "{\"message\":\"Hello World from Julia!\"}")
end

mg_register!("get", "/hello", greet)

mg_serve!()
# mg_shutdown!()

```

It is currently added in [web frameworks benchmark](https://web-frameworks-benchmark.netlify.app/result?l=julia).

I hope it helps someone and push Julia (at least a little) to be widely adopted for web development.

---

<div class="post-metadata">

**Author:** ![technocrat](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/technocrat/32/220947_2.png) [@technocrat](https://discourse.julialang.org/u/technocrat)\
**Post date:** [July 28, 2025, 1:49am UTC](https://discourse.julialang.org/t/ann-mongoose-jl-build-simple-web-servers/131117/2 "2025-07-28T01:49:16Z")

</div>

I love “Hello, world.” Tiny bit of friction. Where does it expect to put the favicon.ico?

---

<div class="post-metadata">

**Author:** ![liuyxpp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/liuyxpp/32/9870_2.png) [@liuyxpp](https://discourse.julialang.org/u/liuyxpp)\
**Post date:** [July 28, 2025, 2:00am UTC](https://discourse.julialang.org/t/ann-mongoose-jl-build-simple-web-servers/131117/3 "2025-07-28T02:00:51Z")

</div>

Why you prefix all functions with mg\_ which to me is very ugly. I’d like to mark those public API using the `public` keyword instead of `export`, and if in case of confilicts, use `import Mongoose as mg` and simply do `mg.serve!()`, etc.

---

<div class="post-metadata">

**Author:** ![GHTaarn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ghtaarn/32/216007_2.png) [@GHTaarn](https://discourse.julialang.org/u/GHTaarn)\
**Post date:** [July 28, 2025, 2:51am UTC](https://discourse.julialang.org/t/ann-mongoose-jl-build-simple-web-servers/131117/4 "2025-07-28T02:51:01Z")

</div>

The very mature HTTP.jl package can also make simple HTTP servers in few lines of code, e.g.:

```julia
using HTTP
HTTP.serve() do request
    HTTP.Response(200, "Welcome to my server")
end

```

What advantages does Mongoose.jl have?

---

<div class="post-metadata">

**Author:** ![jd-foster](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jd-foster/32/35824_2.png) [@jd-foster](https://discourse.julialang.org/u/jd-foster)\
**Post date:** [July 28, 2025, 11:52am UTC](https://discourse.julialang.org/t/ann-mongoose-jl-build-simple-web-servers/131117/5 "2025-07-28T11:52:08Z")

</div>

I would guess that the names just match those used in the C library.

---

<div class="post-metadata">

**Author:** ![jd-foster](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jd-foster/32/35824_2.png) [@jd-foster](https://discourse.julialang.org/u/jd-foster)\
**Post date:** [July 28, 2025, 11:52am UTC](https://discourse.julialang.org/t/ann-mongoose-jl-build-simple-web-servers/131117/6 "2025-07-28T11:52:55Z")

</div>

Very nice work!

---

<div class="post-metadata">

**Author:** ![AbrJA](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abrja/32/207387_2.png) [@AbrJA](https://discourse.julialang.org/u/AbrJA)\
**Post date:** [July 28, 2025, 8:21pm UTC](https://discourse.julialang.org/t/ann-mongoose-jl-build-simple-web-servers/131117/7 "2025-07-28T20:21:24Z")

</div>

Correct, as @jd-foster mentioned I tried to keep the same naming style as the C library has. I hesitated to add the mg prefix but I did it to avoid collisions. Naming is hard.

I think a solution could be to use alias with `public` keyword for those exported functions (`public serve! = mg_serve!`)

---

<div class="post-metadata">

**Author:** ![AbrJA](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abrja/32/207387_2.png) [@AbrJA](https://discourse.julialang.org/u/AbrJA)\
**Post date:** [July 28, 2025, 8:51pm UTC](https://discourse.julialang.org/t/ann-mongoose-jl-build-simple-web-servers/131117/8 "2025-07-28T20:51:08Z")

</div>

Yes, I agree and it doesn’t try to replace it, I just wanted to offer another alternative in the Julia world.

Personally I have been using [Oxygen.jl](https://github.com/OxygenFramework/Oxygen.jl) (based on `HTTP.jl`) to deploy some models into production and I truly recommend it.

Regarding the advantages:

- For very simple endpoints [it has better performance](https://web-frameworks-benchmark.netlify.app/result?l=julia)
- It doesn´t have dependencies just Mongoose\_jll
- It is way simpler than HTTP.jl
