npm.io
0.17.23 • Published 5 years ago

flux-drive

Licence
Version
0.17.23
Deps
20
Size
1.6 MB
Vulns
21
Weekly
30

FLUX-Drive

Content Management System for Node.js and React

Setup

  1. Install flux-drive npm:
npm install flux-drive --save
  1. Create flux-drive.js in your project root path:
exports.config = {

    /**
    * General Settings
    */

    general: {
        projectKey: "------------PERMALINK------------",
        allowRegistration: true,
        allowMediaRemove: true
    },

    /**
    * Database Settings (MongoDB)
    */

    db: {
        development: {
            url: 'mongodb://USER:PASSWORD@HOST:PORT/NAME'
        },
        staging: {
            url: 'mongodb://USER:PASSWORD@HOST:PORT/NAME'
        },
        production: {
            url: 'mongodb://USER:PASSWORD@HOST:PORT/NAME'
        }
    },

    /**
    * CDN (Amazon S3)
    */

    cdn: {    
        development: {            
            accessKeyId: "----------AWS-KEY-ID----------",
            secretAccessKey: "----------AWS-SECRET----------",
            bucket: "----------S3-CONTENT-BUCKET-NAME----------",
            cdnUrl: "//----------URL-TO-CONTENT-BUCKET----------/",
            assetsUrl: "//----------URL-TO-ASSETS-BUCKET----------/",
            maxFileSize: '15mb',
            region: 'us-east-1'
        },
        staging: {            
            accessKeyId: "----------AWS-KEY-ID----------",
            secretAccessKey: "----------AWS-SECRET----------",
            bucket: "----------S3-CONTENT-BUCKET-NAME----------",
            cdnUrl: "//----------URL-TO-CONTENT-BUCKET----------/",
            assetsUrl: "//----------URL-TO-ASSETS-BUCKET----------/",
            maxFileSize: '15mb',
            region: 'us-east-1'
        },
        production: {            
            accessKeyId: "----------AWS-KEY-ID----------",
            secretAccessKey: "----------AWS-SECRET----------",
            bucket: "----------S3-CONTENT-BUCKET-NAME----------",
            cdnUrl: "//----------URL-TO-CONTENT-BUCKET----------/",
            assetsUrl: "//----------URL-TO-ASSETS-BUCKET----------/",
            maxFileSize: '15mb',
            region: 'us-east-1'
        }
    },

    /**
     * Mailer Settings (Amazon SES)
     */

    mailer: {        
        development: {
            accessKeyId: "----------AWS-KEY-ID----------",
            secretAccessKey: "----------AWS-SECRET----------",
            sender: "----------NO-REPLY@YOUR-DOMAIN----------"
        },
        staging: {
            accessKeyId: "----------AWS-KEY-ID----------",
            secretAccessKey: "----------AWS-SECRET----------",
            sender: "----------NO-REPLY@YOUR-DOMAIN----------"
        },
        production: {
            accessKeyId: "----------AWS-KEY-ID----------",
            secretAccessKey: "----------AWS-SECRET----------",
            sender: "----------NO-REPLY@YOUR-DOMAIN----------"
        }
    }

};
  1. Require flux-drive before your routes
(...)

// Load Flux-Drive

require('flux-drive')(app);

// Your Routes

var routes = require('./api/routes');
app.use(routes);

(...)