$ npm install evt-xtrm --save
You can use a local database or external such as mlab.com.
- Install mongodb https://docs.mongodb.com/v3.0/administration/install-on-linux/
- create db user
$ mongo evt-xtrm-db --eval 'db.createUser({user: "test", pwd: "test", roles: [ { role: "readWrite", db: "config" } ]});'
Just export your connection url to environment
$ export MONGO_URL=[your mongodb url]
server = require('evt-xtrm')({
passport: {
enable: true,
permissionSecurity: true,
secret: [your secret for passport],
facebook: {
enable: true,
AppID: [app id], //Option could be set in environment
AppSecret: [app secret] //Optional could be set in environment
},
baseUrl: [Base url] //Optional is localhost by default.
}
});
// then use your server!
server.get(...
Here is a list of environment variables you could set
$ export PORT=[Port to listen on]
$ export FACEBOOK_APPID=[AppID]
$ export FACEBOOK_APPSECRET=[AppSecret]
Create a new app on https://developers.facebook.com/. Remember to set your Site URL(http://localhost:10010 for dev)
$ git clone https://github.com/Eskalol/evt-xtrm.git
$ cd evt-xtrm
$ npm install -g swagger
$ npm install
Run swagger and swagger browser:
$ swagger project start
$ swagger project edit
Check the issue tracker.
- When playing with swagger it's recomended to use these settings:
require('evt-xtrm')({
passport: {
enable: true,
permissionSecurity: false,
...
}
});
Rest of the settings is optional. The reason why permissionSecurity should be set to false is because we are using a custom middleware which is not integrated with swagger. This is just a temporary solution and will be fixed when swagger implement cookie session auth.