cvbsp-directory
Directory and authentification app built on top of express
Last updated 8 months ago by vlemaitre .
MIT · Original npm · Tarball · package.json
$ cnpm install cvbsp-directory 
SYNC missed versions from official npm registry.

Directory and authentification app built on top of express

install

npm i cvbsp-directory

config

add config.json file (inside the working directory in dev mode, outside in production mode), here is the mandatory parameters:

"URL_MONGO":"mongodb://localhost:27017/",
"DB_NAME":"name_of_db"
"PORT":3333, // port number that you wish to use
"PRIVATE_KEY":"4XAgpTaS1RCSrYZ6K5Kq", // private key to use for the password encryption
"LOG_PATH":"./dev.log", // path to the log file
"LOG_LEVEL" : "debug", // any of this "fatal", "error", "warn", "info", "debug"
"TOKEN_EXPIRY_IN_SEC":86400, // timelapse for expiry of the token for authenticated user in seconds
"REQ_LIMIT_MB":100, // Request size limit in Mb
"SUPERVISOR_PASSWORD":"password", // Supervisor password in clear
"DIR_FILES":"./_Files/" // path to the directory where data will be stored
"DEFAULT_LANG": "fr", // default lang uses if no lang define on user
"DOMAIN_ROOT_NAME": "root",
"PREFIX_URL": "/api/v2",
"STATIC_PATH": "/resources", // relative url to access the doc in DIR_FILES from outside
"EXTERNAL_PATH_TO_FILES": "http://localhost:3000/resources/", // external path to access the file, can be outside of the this app
"DEFAULT_DOMAIN_ID": "xxxxx-xxx-xx-xx-xxxx", // id of the default domain to use when user auto-register
"EMAIL" : { // Email sender configuration
    "HOST":"url_string",
    "PORT":000,
    "SECURE":boolean,
    "USER":"email_adress",
    "PWD":"************",
    "DEFAULT_FROM":"email_adress",
    "FILE_INIT_PATH": "/path/to/emails.json"
},
"DEFAULT_ROOT_SETTINGS": {
    "title": "Cvbsp",
    "logo": { "type" : "file" },
    "primaryColor": { "type" : "color" },
    "secondaryColor": { "type" : "color" },
    "successColor": { "type" : "color" },
    "dangerColor": { "type" : "color" },
    "warningColor": { "type" : "color" },
    "prop1": "value1" // to add new setting
}

licence

the licence file is use to activate or desactivate feature, it can be used with plugins, content is an js object:

{}

data

make sure to create an emails file corrsponding to the path "FILE_INIT_PATH": "/path/to/emails.json" in the config file . email notifications file must have the followings to work properly : { "name" : "RESET_PASSWORD", "subject" : { "en" : "Reset password", "fr" : "Réinitialiser le mot de passe" }, "body" : { "fr" : "<p>Voici votre code pour réinitialiser votre mot de passe</p><p>Code : ##CODE##</p>", "en" : "<p>Below is the code to reset your password</p><p>Code : ##CODE##</p>" }, "isHtml" : true, "isActive" : true }, { "name" : "VERIFY_EMAIL", "subject" : { "en" : "Verify email", "fr" : "Vérifier votre email" }, "body" : { "fr" : "<p>Voici votre code pour vérifier votre email</p><p>Code : ##CODE##</p>", "en" : "<p>Below is the code to verify your email</p><p>Code : ##CODE##</p>" }, "isHtml" : true, "isActive" : true }

use

and then just Use like express:

  • Javacsript:
const cvbspDirectory = require('cvbsp-directory');

const newRouter = require('./controller');
App.use('/path', newRouter);
const server = cvbspDirectory.App.listen(3000, () => {    
    console.log('Express server with cvsbp directory listening on port ' + 3000);
});
  • Typescript:
import { App } from 'cvbsp-directory';
import { newRouter } from './controller';
App.use('/path', newRouter);
const server = App.listen(3000, () => {    
    console.log('Express server listening on port ' + 3000);
    require('./all.spec'); 
});

Current Tags

  • 1.3.1                                ...           latest (8 months ago)

20 Versions

  • 1.3.1                                ...           8 months ago
  • 1.3.0                                ...           8 months ago
  • 1.2.0                                ...           8 months ago
  • 1.1.13                                ...           8 months ago
  • 1.1.12                                ...           9 months ago
  • 1.1.11                                ...           9 months ago
  • 1.1.10                                ...           9 months ago
  • 1.1.9                                ...           10 months ago
  • 1.1.8                                ...           10 months ago
  • 1.1.7                                ...           10 months ago
  • 1.1.6                                ...           10 months ago
  • 1.1.4                                ...           a year ago
  • 1.1.3                                ...           a year ago
  • 1.1.2                                ...           a year ago
  • 1.1.1                                ...           a year ago
  • 1.0.4                                ...           a year ago
  • 1.0.3                                ...           a year ago
  • 1.0.2                                ...           a year ago
  • 1.0.1                                ...           a year ago
  • 1.0.0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (22)
Dev Dependencies (7)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |