Markoa consists of the following main parts:
- app
- app container
- server
- utils
To access each part, simply use the main markoa
object as follows:
let markoa = require('markoa');
let app = markoa.app;
// create new container instance
let appContainer = markoa.appContainer();
let server = markoa.server
let utils = markoa.utils
It is super simple to setup the Markoa server with some basic settings:
let marko = require('markoa');
let lassoFile = path.join(__dirname, './lasso-config.json');
let staticDir = path.join(__dirname, '../public');
let app = markoa.server.configure(koa(), {
port: 4004,
lasso: {
file: lassoFile,
},
static: {
dir: staticDir
debug: true,
force: true
}
});
By default the koa server will use port 4000
if no settings are provided.
Run npm link
from markoa root folder to link the package.
Then from an app or appContainer that uses markoa, use npm link markoa
to link the dependency, which creates a symbolic link in your node_modules
pointing to your local markoa package.
Now run npm install
from your app ;)