1.0.12 • Published 4 years ago
mative v1.0.12
Mative (beta)
Mative open source CMS (currently in BETA!).
Future updates
- Mative Dashboard.
- Plugins manager.
- Manually config installation will be removed.
Installation
Use the package manager npm to install mative.
npm i mative
Usage
Create a file called server.js (or anything you like) in your main directory, and paste the following in it:
const { MativeServer, Mative, Log } = require('mative');
const helmet = require('helmet');
const compression = require('compression');
(async() => {
Mative.express('use')(helmet());
Mative.express('use')(compression());
await MativeServer.start(__dirname).catch(error => {
Log('\x1b[31m*Error* Mative -> ' + error + '\x1b[0m');
});
})();
Your server should be live! You still need to do the setup, you can find this on server-ip:80/mative-setup.
Routers
const { MativeServer, Mative, Log } = require('mative');
const helmet = require('helmet');
const compression = require('compression');
(async() => {
Mative.express('use')(helmet());
Mative.express('use')(compression());
await MativeServer.start(__dirname).catch(error => {
Log('\x1b[31m*Error* Mative -> ' + error + '\x1b[0m');
});
// The positision of this script doesn't matter, it can be before or after MativeServer.start().
// https://expressjs.com/en/guide/routing.html
Mative.express('use')(
'/index', // this can be anything, like /user/123, /user/:id, /user/:id/dashboard
require('./www/modules/index') // path to your router
);
})();
Dashboard
Your dashboard is available on my.mative.io!