Skip to content

Instantly share code, notes, and snippets.

@hoangsetup
Last active September 20, 2021 08:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hoangsetup/392d84bc40240ef079493fc82fac4423 to your computer and use it in GitHub Desktop.
Save hoangsetup/392d84bc40240ef079493fc82fac4423 to your computer and use it in GitHub Desktop.
// src/app.ts
import express, { Router } from 'express';
import callStateController from './controllers/call.state.controller';
import * as path from 'path';
const app = express();
app.use(express.json());
app.get('/', (req, res) => {
res.sendFile(path.join(process.env.PUBLIC_DIR as string, 'index.html'));
});
const router = Router();
router.post('/call-states', callStateController.handleNewCallState);
app.use('/api/v1', router);
export default app;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment