Skip to content
This repository has been archived by the owner on Mar 14, 2019. It is now read-only.

Customizing the HTTP URLs and Headers

Brylie Christopher Oxley edited this page Mar 3, 2015 · 1 revision

CollectionFS automatically mounts an HTTP access point that supports secure GET, PUT, HEAD, and DELETE requests for all FS.Collection instances.

To change the base URL for the endpoints:

common.js

FS.HTTP.setBaseUrl('/files');

It's important to call this both on the server and on the client. Also be sure that the resulting URL will not conflict with other resources.

To add custom headers for files returned by the GET endpoint:

server.js or common.js

FS.HTTP.setHeadersForGet([
  ['Cache-Control', 'public, max-age=31536000']
]);