2020-03-24 21:11:11 +01:00

30 lines
679 B
JavaScript

import user from './user'
import inbox from './inbox'
import express from 'express'
import cors from 'cors'
import verify from './verify'
export default function () {
const router = express.Router()
router.use(
'/activitypub/users',
cors(),
express.json({
type: ['application/activity+json', 'application/ld+json', 'application/json'],
}),
express.urlencoded({ extended: true }),
user,
)
router.use(
'/activitypub/inbox',
cors(),
express.json({
type: ['application/activity+json', 'application/ld+json', 'application/json'],
}),
express.urlencoded({ extended: true }),
verify,
inbox,
)
return router
}