froncubator-bridge

0.0.71 • Public • Published

install

npm install froncubator-bridge

requires

Yout should install "mongoose": "5.2.4". Because current version mongoose of Froncubator Bridge, save state of models and connect models to admin panel.

const express = require('express');
const app = express();
 
// set static path to show uploaded files in admin panel
app.use('/admin/static/uploads', express.static(`${__dirname}/uploads`))
 
// connect models before init froncubator bridge module
require('./models/user');
require('./models/post');
 
// init froncubator bridge
// after that, you can open "HOST/admin" in your browser.
// when your open "/admin" first time, you can create "superadmin" account
 
require('froncubator-bridge')(app, {
  uploadDir: `${__dirname}/uploads`,
  logsDir: `${__dirname}/logs`,
  mongo: {
    models: `${__dirname/models}`,
    url: 'mongo://127.0.0.1',
    port: 27017,
    dbName: process.env.mongodbName,
    user: process.env.mongodbUser,
    pass: process.env.mongodbPass,
    auth: true
  } 
});
 
app.listen(3000);

Readme

Keywords

none

Package Sidebar

Install

npm i froncubator-bridge

Weekly Downloads

0

Version

0.0.71

License

MIT

Unpacked Size

3.82 MB

Total Files

49

Last publish

Collaborators

  • philsitumorang