Clone app package
git clone https://nguyenngocphuongnb@bitbucket.org/nguyenngocphuongnb/laco.git your-app-name
cd your-app-name
npm install
Make Laco commander executable on linux
chmod +x laco
Configure your app
./laco config
Install Laco app
./laco install
router.register({
name: 'home',
label: 'Home page',
priority: 2,
path: '/',
get: (req, res, next) => {
res.end('Login page')
}
});
router.middleware({
route: 'login',
get: (req, res, next) => {
res.end('login end');
}
});
router.attach('home', 'post', (req, res) => {
res.end('This is a handler for "POST" attach to "Home" router that does not existed before')
})
router.detach('home', 'post') //"POST" handler is now no longer available from "Home" router
sudo docker build -t laco-app .
sudo docker run laco-app node -v
sudo docker run -p 2811:2811 -ti laco-app