18 lines
427 B
TypeScript
18 lines
427 B
TypeScript
|
import { Drash, CORSService } from './deps.ts';
|
||
|
import HomeResource from "./opengraph.ts";
|
||
|
import { dotenv } from "./deps.ts";
|
||
|
|
||
|
const ENV = await dotenv.load();
|
||
|
|
||
|
const cors = new CORSService();
|
||
|
const server = new Drash.Server({
|
||
|
hostname: "localhost",
|
||
|
port: Number(ENV["APP_PORT"]),
|
||
|
protocol: "http",
|
||
|
services: [cors],
|
||
|
resources: [HomeResource],
|
||
|
});
|
||
|
|
||
|
server.run();
|
||
|
|
||
|
console.log(`Server running at ${server.address}.`);
|