26 lines
465 B
TypeScript
26 lines
465 B
TypeScript
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;
|