hiling-opengraph/main.ts

18 lines
427 B
TypeScript
Raw Permalink Normal View History

2023-10-11 12:08:57 +07:00
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}.`);