Federated video streaming platform using ActivityPub and P2P in the web browser with Angular. https://joinpeertube.org/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

29 lines
705 B

  1. import { HttpStatusCode } from '../../../shared/models/http/http-error-codes'
  2. import { ApiCache, APICacheOptions } from './shared'
  3. const defaultOptions: APICacheOptions = {
  4. excludeStatus: [
  5. HttpStatusCode.FORBIDDEN_403,
  6. HttpStatusCode.NOT_FOUND_404
  7. ]
  8. }
  9. function cacheRoute (duration: string) {
  10. const instance = new ApiCache(defaultOptions)
  11. return instance.buildMiddleware(duration)
  12. }
  13. function cacheRouteFactory (options: APICacheOptions) {
  14. const instance = new ApiCache({ ...defaultOptions, ...options })
  15. return instance.buildMiddleware.bind(instance)
  16. }
  17. // ---------------------------------------------------------------------------
  18. export {
  19. cacheRoute,
  20. cacheRouteFactory
  21. }