Building Slack integration
This commit is contained in:
@@ -3,6 +3,7 @@ import cors from 'cors';
|
||||
import notesRouter from './routes/notes.routes.js';
|
||||
import ingestRouter from './routes/ingest.routes.js';
|
||||
import webhooksRouter from './routes/webhooks.routes.js';
|
||||
import slackRouter from './routes/slack.routes.js';
|
||||
|
||||
const app = express();
|
||||
|
||||
@@ -13,6 +14,10 @@ app.use(cors());
|
||||
// Moving this below express.json silently breaks every signature check.
|
||||
app.use('/v1/webhooks', express.raw({ type: '*/*', limit: '2mb' }), webhooksRouter);
|
||||
|
||||
// Slash commands are form-encoded and signed over the same raw bytes, so this
|
||||
// router sits above express.json for the reason described above.
|
||||
app.use('/v1/slack', express.raw({ type: '*/*', limit: '2mb' }), slackRouter);
|
||||
|
||||
app.use(express.json({ limit: '2mb' }));
|
||||
app.use('/v1/notes', ingestRouter);
|
||||
app.use('/v1/notes', notesRouter);
|
||||
|
||||
Reference in New Issue
Block a user