Created
August 3, 2020 13:24
-
-
Save azaharafernandezguizan/c16b2196d3e8c245079552751c6fbe20 to your computer and use it in GitHub Desktop.
File app of Deno Server
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' | |
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