DEV Community

Discussion on: Write a small API using Deno

Collapse
 
anditsou profile image
Ítalo Sousa

I had the same issue. It's an issue that happens after newer updates at Deno's TS compiler. You should explicitly type those variables. I did this way and it worked for me:

import { Response } from 'https://deno.land/x/oak/mod.ts';

const hello = ({ response }: { response: Response}) => {
    response.body = { message: 'Hello World' };
};

export default {
    hello
}