Cloud CMS Application Server

3.2.353 · active · verified Tue Apr 21

The `cloudcms-server` package provides a robust Node.js application server framework specifically designed to integrate with Cloud CMS deployments. It offers core server-side functionalities, including request routing, error handling, view engine support (e.g., Handlebars), and a flexible storage mechanism. This storage mechanism can utilize local file systems, Amazon S3, or S3FS for managing application content, configuration, and temporary data. The current stable version is 3.2.353, indicating a mature and actively maintained project. It serves as the foundational backbone for the application server tier of Cloud CMS, typically hosted at cloudcms.net, enabling developers to build and deploy applications that deeply leverage Cloud CMS's Web Content Management (WCM) capabilities. Key differentiators include its deep, purpose-built integration with the Cloud CMS platform, highly extensible configuration options for various storage backends, and a pluggable architecture that allows for custom functions at different stages of the request lifecycle.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart initializes and starts a `cloudcms-server` instance with a basic configuration, including a custom route and WCM enabled. It demonstrates how to import the server module, define its configuration, and handle startup.

import cloudcmsServer from 'cloudcms-server';

const serverConfig = {
    "setup": "single",
    "name": "My Cloud CMS Application",
    "socketFunctions": [],
    "routeFunctions": [
        async function(req, res, next) {
            if (req.url === '/') {
                return res.send('Welcome to your Cloud CMS powered application!');
            }
            next();
        }
    ],
    "errorFunctions": [],
    "configureFunctions": {},
    "viewEngine": "handlebars",
    "wcm": {
        "enabled": true, // Enable WCM features
        "cache": false
    },
    "auth": {
        "enabled": true,
        "providers": {}
    },
    "port": process.env.PORT ?? 3000,
    "host": process.env.HOST ?? '0.0.0.0'
};

async function startServer() {
    try {
        const server = await cloudcmsServer.start(serverConfig);
        console.log(`Cloud CMS Application Server started successfully on port ${server.port}`);
        console.log('Access it at http://localhost:' + server.port);
    } catch (err) {
        console.error('Failed to start Cloud CMS Application Server:', err);
        process.exit(1);
    }
}

startServer();

view raw JSON →