Created
March 6, 2021 06:43
-
-
Save mayankchoubey/0724f56e3598aefe25eb8c31e816b8ca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Application } from "https://deno.land/x/oak/mod.ts"; | |
const text = await Deno.readTextFile("/var/tmp/sample.json"); | |
const json = JSON.parse(text); | |
const app = new Application(); | |
app.use((ctx) => { | |
ctx.response.body = json; | |
}); | |
await app.listen({ port: 3000 }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment