You are looking at the old Apostrophe 0.5 documentation. It is deprecated for new projects. Check out the latest version!

Options provided to modules

← Previous: A simple module

In addition to the options you specify for each module in app.js when configuring your project, all modules receive:

apos: the apos object, a singleton which provides core methods for content management. See the apostrophe module documentation.

app: the Express app object. You can add routes via app.get,, etc. at any time in your module's constructor. Our convention is to prefix routes with /apos/modulename, where modulename is a short name for the module (blog, not apostrophe-blog). This prevents conflicts with URLs used for pages.

pages: the pages object, a singleton which provides methods for dealing with the page tree. See the apostrophe-pages module documentation.

schemas: the schemas object, a singleton which provides methods for dealing with schemas. You may wish to use this if your module handles form submissions and would like the same conveniences that fancy pages and snippets have. See the apostrophe-schemas module documentation.

mailer: a nodemailer transport object, ready to send email as needed. See the nodemailer documentation.

site: an object containing title, shortName and hostName properties, as configured in app.js. We suggest using shortName to name databases and other resources specific to your project.

modules: this is not what you think. See accessing other modules for the right way to access other modules.

Next: Pushing assets to the browser →