# \#opium

**URL:** https://discuss.ocaml.org/tag/opium/151.md

[Latest](https://discuss.ocaml.org/latest.md) · [Categories](https://discuss.ocaml.org/categories.md) · [Tags](https://discuss.ocaml.org/tags.md)

---

## [Lwt thread continues after return](https://discuss.ocaml.org/t/lwt-thread-continues-after-return/15962)

<div class="topic-metadata">

**Author:** [@frederic-lang](https://discuss.ocaml.org/u/frederic-lang)\
**Replies:** 6\
**Last updated:** [January 15, 2025, 2:32pm UTC](https://discuss.ocaml.org/t/lwt-thread-continues-after-return/15962 "2025-01-15T14:32:34Z")

</div>

Hello, I am trying to design an server with asynchronous task. For some endpoints, the server responds with a 202 “accepted” response and I would like to start here a lwt thread to process a computation. The way you d…

---

## [Designing a back-end framework : callbacks types](https://discuss.ocaml.org/t/designing-a-back-end-framework-callbacks-types/15808)

<div class="topic-metadata">

**Author:** [@frederic-lang](https://discuss.ocaml.org/u/frederic-lang)\
**Replies:** 1\
**Last updated:** [December 17, 2024, 7:23pm UTC](https://discuss.ocaml.org/t/designing-a-back-end-framework-callbacks-types/15808 "2024-12-17T19:23:49Z")

</div>

Hi, I am currently working on a back-end framework implemented with Opium. The main point of this framework is to declare the routes in tree-like structure and then be able to generate a describeApi endpoint that descr…

---

## [\[ANN\] Opium 0.20.0](https://discuss.ocaml.org/t/ann-opium-0-20-0/6955)

<div class="topic-metadata">

**Author:** [@tmattio](https://discuss.ocaml.org/u/tmattio)\
**Replies:** 0\
**Last updated:** [December 11, 2020, 12:48pm UTC](https://discuss.ocaml.org/t/ann-opium-0-20-0/6955 "2020-12-11T12:48:55Z")

</div>

I’m pleased to announce a new version of Opium web framework (0.20.0) is available on Opam. Here’s the changelog: Added New Auth module to work with Authorization header (#238) New basic\_auth middleware to protect…

---

## [\[ANN\] Opium 0.19.0](https://discuss.ocaml.org/t/ann-opium-0-19-0/6876)

<div class="topic-metadata">

**Author:** [@tmattio](https://discuss.ocaml.org/u/tmattio)\
**Replies:** 7\
**Last updated:** [November 30, 2020, 5:04pm UTC](https://discuss.ocaml.org/t/ann-opium-0-19-0/6876 "2020-11-30T17:04:50Z")

</div>

On behalf of the Opium team, I am pleased to announce a new version of Opium (0.19.0) is available on Opam. This release comes with a complete rewrite of Opium’s internals to switch from Cohttp to Httpaf (work done by @…

---

## [How to set Cookie with Opium?](https://discuss.ocaml.org/t/how-to-set-cookie-with-opium/5808)

<div class="topic-metadata">

**Author:** [@koji-k](https://discuss.ocaml.org/u/koji-k)\
**Replies:** 1\
**Last updated:** [May 20, 2020, 8:48am UTC](https://discuss.ocaml.org/t/how-to-set-cookie-with-opium/5808 "2020-05-20T08:48:50Z")

</div>

I try to use Cookie with Opium. sample code explains how to use Cookie module. Therefore i wrote a following code. let test = get "/auth/test" begin fun (\_req: Request.t) -\> \`String "aaa" |\> respond |\> Coo…

---

## [Opium and DB connections](https://discuss.ocaml.org/t/opium-and-db-connections/4434)

<div class="topic-metadata">

**Author:** [@diegogub](https://discuss.ocaml.org/u/diegogub)\
**Replies:** 1\
**Last updated:** [April 9, 2020, 2:27am UTC](https://discuss.ocaml.org/t/opium-and-db-connections/4434 "2020-04-09T02:27:06Z")

</div>

Hello, How would you handle DB connections within a HTTP request using Opium web framework? I’m trying to use Redis driver and I’m getting weird results. Like requests are being cached, and no new connection to DB is m…

---

## [A Lightweight OCaml Webapp Tutorial (Using Opium, Caqti, and Tyxml)](https://discuss.ocaml.org/t/a-lightweight-ocaml-webapp-tutorial-using-opium-caqti-and-tyxml/4967)

<div class="topic-metadata">

**Author:** [@shonfeder](https://discuss.ocaml.org/u/shonfeder)\
**Replies:** 6\
**Last updated:** [January 11, 2020, 8:46pm UTC](https://discuss.ocaml.org/t/a-lightweight-ocaml-webapp-tutorial-using-opium-caqti-and-tyxml/4967 "2020-01-11T20:46:42Z")

</div>

The tutorial is hosted on gitlab pages, out of this repository. I put this together in response to some requests for introductory material on the topic (here and on /r/ocaml. I don’t have much expertise to offer in this…

---

## [Opium & Lwt usage and questions](https://discuss.ocaml.org/t/opium-lwt-usage-and-questions/4168)

<div class="topic-metadata">

**Author:** [@sapristi](https://discuss.ocaml.org/u/sapristi)\
**Replies:** 6\
**Last updated:** [August 2, 2019, 12:21pm UTC](https://discuss.ocaml.org/t/opium-lwt-usage-and-questions/4168 "2019-08-02T12:21:49Z")

</div>

Hello, I am porting a project previously based on a synchronous nethttpd server to Opium. I’d first like to thank @rgrinberg for Opium, which is so much easier to set up than nethttpd :). Since I am not much used to ev…

---

## [How would you structure a dune project for web development with opium and js\_of\_ocaml?](https://discuss.ocaml.org/t/how-would-you-structure-a-dune-project-for-web-development-with-opium-and-js-of-ocaml/2441)

<div class="topic-metadata">

**Author:** [@loxs](https://discuss.ocaml.org/u/loxs)\
**Replies:** 1\
**Last updated:** [August 16, 2018, 12:04am UTC](https://discuss.ocaml.org/t/how-would-you-structure-a-dune-project-for-web-development-with-opium-and-js-of-ocaml/2441 "2018-08-16T00:04:51Z")

</div>

Currently I’m starting from something like: js/to\_compile\_with\_jsoo.ml bin/web\_backend.ml lib/common\_files.ml static/styles.css What I don’t know how to solve in a reliable and nice way that works both in dev and produ…

---

## [Question regarding which package to include](https://discuss.ocaml.org/t/question-regarding-which-package-to-include/653)

<div class="topic-metadata">

**Author:** [@bobbypriambodo](https://discuss.ocaml.org/u/bobbypriambodo)\
**Replies:** 4\
**Last updated:** [August 2, 2017, 7:04am UTC](https://discuss.ocaml.org/t/question-regarding-which-package-to-include/653 "2017-08-02T07:04:13Z")

</div>

Hello, I’m having a weird error here. I made a little project using Opium and worked on it last week. I’m using jbuilder for the build system. I had the following on my jbuild file: (jbuild\_version 1) (library ( (nam…
