Skip to content

Instantly share code, notes, and snippets.

@azaharafernandezguizan
Created August 3, 2020 13:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azaharafernandezguizan/c16b2196d3e8c245079552751c6fbe20 to your computer and use it in GitHub Desktop.
Save azaharafernandezguizan/c16b2196d3e8c245079552751c6fbe20 to your computer and use it in GitHub Desktop.
File app of Deno Server
import { Application } from 'https://deno.land/x/oak/mod.ts'
import { oakCors } from 'https://deno.land/x/cors/mod.ts';
import router from './routes.ts'
const HOST = '127.0.0.1'
const PORT = 7700
const app = new Application()
app.use(oakCors()); // Enable CORS for All RoutesS
app.use(router.routes());
app.use(router.allowedMethods());
await app.listen(`${HOST}:${PORT}`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment