zappyzep/src/dashboard/api/index.ts

20 lines
423 B
TypeScript
Raw Normal View History

2019-05-26 00:13:42 +03:00
require("dotenv").config();
import express from "express";
import initAuth from "./auth";
import { connect } from "../../data/db";
console.log("Connecting to database...");
connect().then(() => {
const app = express();
initAuth(app);
app.get("/", (req, res) => {
res.end("Hi");
});
const port = process.env.PORT || 3000;
app.listen(port, () => console.log(`API server listening on port ${port}`));
});