For questions about Oak, the middleware framework for Deno's net server
Questions tagged [oak]
77 questions
1
vote
1 answer
Is Oak for Deno primarily intended for static routing? Or can it handle dynamic routing (straightforwardly) too?
I am currently learning Oak for Deno.
I have grasped how to declare a static route to an API endpoint:
import helloWorld from './hello-world.ts';
// [... MORE CODE ...]
router.get('/hello-world', ({ response }: { response: any }) => {
…

Rounin
- 27,134
- 9
- 83
- 108
1
vote
2 answers
Handling multipart/form-data with Deno and Oak
I'm making slow but steady progress in learning Deno and Oak but this has me stumped. I have a simple web form with a file upload field:
1
vote
1 answer
Using Handlebars with Deno v1.6.x
I'm struggling to get the Handlebars templating working with Deno v1.6.x, any thoughts?
$ deno --version
deno 1.6.2 (release, x86_64-unknown-linux-gnu)
v8 8.8.278.2
typescript 4.1.3
$ tree
.
├── template.js
└── views
├── layouts
│ └──…

Mark Tyers
- 2,961
- 4
- 29
- 52
1
vote
2 answers
Route router to another router in Oak framework like ExpressJS
Thing I want to achieve is create multiple routers and a main router that routes requests to other routers.
router.use("/strategy", strategyRoutes);
router.use("/account", accountRoutes);
router,strategyRoutes and accountRoutes are express.Router()…

ZE0TRON
- 94
- 6
1
vote
1 answer
Return csv file - Deno
i'd like return csv file on an API with Deno & oak library. I've generated my csv file, but i dont know how can i return it to my GET endpoint for downlload.
let fileName: string = `./temp/activities`
fileName += start ? `-(${start})` : ``
…

Jess182
- 21
- 4
1
vote
1 answer
How would I group routes deno's oak framework?
The problem I currently have is, that I got some routes for my API that I want to group such for each route of that group, some authentication middleware can execute. Let's say I have a list of nodes, then my current implementation looks like…

Benko
- 43
- 3
1
vote
1 answer
Deno oak compatible types for request and response
I have been playing with Deno Oak. Looked at some of the basic routing examples and none of them are using types for request or response.
router
.post("/api/v1/products", addProduct)
const addProduct = async (
{ request, response }: {
…

Gurpreet Singh
- 20,907
- 5
- 44
- 60
1
vote
1 answer
trouble rendering view in deno/oak
I'm using deno, oak, and view_engine.
Here is my file structure:
server.ts
routes
user.ts
view
index.ejs
/user
index.ejs
On my server.js this code works as expected:
router
.get("/", (context: any) => {
…

William
- 31
- 5
1
vote
1 answer
Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://localhost:4000/style.css"
I am using deno, oak and denjucks. The file structure is as below -
index.html
index.ts
style.css
the code I have used are as below -
index.ts is-
import {Application, send} from "https://deno.land/x/oak/mod.ts";
import denjucks from…

ashok kumar
- 49
- 5
1
vote
1 answer
memory allocation of 59365708876800 bytes failed in Deno, Mongo databse
I'm creating API using Deno and my database as Mongo Database. I try to run my File like below and I got an error like memory allocation of 59365708876800 bytes failed What went wrong here?
D:\Deno Documentation\deno6>deno run --allow-net…

FGH
- 2,900
- 6
- 26
- 59
1
vote
1 answer
Can't do JSON.parse for raw format payload in Deno controller
I am creating a POST method api end point. I am sending the payload as a JSON string in RAW format from the postman. Then I am doing JSON.parse in my deno app controller. But the output after doing the JSON.parse is still a JSON string.
This is my…

atish
- 495
- 5
- 18
1
vote
3 answers
How to serve images using deno's oak?
Deno seems targeting text files, but I also need to serve image files for the website.

Kirill Khvenkin
- 11
- 2
1
vote
2 answers
Deno oak error: Uncaught AssertionError: Unexpected skip of the emit
I am getting error when trying to run simple Deno Js OAK middleware server on my:
Ubuntu 18.04,
Deno 1.0.4,
v8 8.4.300,
typescript 3.9.2
By running either deno run index.js or running deno run -A index.js
$ deno run index.js
Compile…

Nezir
- 6,727
- 12
- 54
- 78
0
votes
1 answer
How do I add an extension to a parameter in oak/deno?
I'm trying to add .rss to the end of a parameterized url:
.get(
"/searches/history/tags/:tag.rss",
controller.getHistoryByTagRss.bind(controller)
)
I need a way to isolate the :tag from the .rss
Currently this isn't working.

chovy
- 72,281
- 52
- 227
- 295
0
votes
0 answers
Roboflow - Deploy to Luxonis OAK code provided by Roboflow does not work
I already tested all the depthai demos listed on https://docs.luxonis.com/en/latest/#demo-script) on my OAK device. Every demo is working fine but when I’m using the Luxonis OAK code provided by Roboflow (Luxonis OAK (On Device) - Roboflow) for my…

Gerald
- 1