mirror of
https://github.com/cheveguerra/api-whatsapp-ts.git
synced 2026-04-19 20:29:28 +00:00
multi
This commit is contained in:
13
src/app.ts
13
src/app.ts
@@ -1,11 +1,4 @@
|
||||
import "dotenv/config"
|
||||
import express from "express"
|
||||
import cors from "cors"
|
||||
import routes from "./infrastructure/router"
|
||||
const port = process.env.PORT || 3001
|
||||
const app = express()
|
||||
app.use(cors())
|
||||
app.use(express.json())
|
||||
app.use(`/`,routes)
|
||||
import Http from "./http";
|
||||
|
||||
app.listen(port, () => console.log(`Ready...${port}`))
|
||||
const http = new Http()
|
||||
http.startServer()
|
||||
0
src/bot/bot.ts
Normal file
0
src/bot/bot.ts
Normal file
18
src/http/index.ts
Normal file
18
src/http/index.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import "dotenv/config";
|
||||
import express from "express";
|
||||
import cors from "cors";
|
||||
import routes from "./infrastructure/router";
|
||||
const port = process.env.PORT || 3001;
|
||||
const app = express();
|
||||
app.use(cors());
|
||||
app.use(express.json());
|
||||
app.use(`/`, routes);
|
||||
|
||||
export default class Http {
|
||||
constructor() {}
|
||||
|
||||
public startServer() {
|
||||
const server = app.listen(port, () => console.log(`Ready...${port}`));
|
||||
return server
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user