skirda-backend/src/private_api.ts

26 lines
465 B
TypeScript
Raw Normal View History

2022-08-19 20:12:06 +00:00
import express from "express";
import privateRoutes from "./routes/private_routes";
class PrivateApi{
public server;
constructor() {
this.server = express();
this.middlewares();
this.routes();
this.server.set('view engine', 'ejs');
this.server.use(express.static('public'));
}
middlewares() {
this.server.use(express.json());
}
routes() {
this.server.use(privateRoutes);
}
}
export default new PrivateApi().server;