mos-eisley
[](http://badge.fury.io/rb/mos-eisley) [](https://codeclimate.com/github/kenjij/mos-eisley) [](https://hakiri.io/github/kenjij/mos-eisley/master)
Ruby server for running a Slackbot.
Requirements
- Ruby >= 2.1
Powered by Sinatra.
Getting Started
Install
$ gem install mos-eisley
Configure
Create a configuration file following the example below.
# Configure application logging
MosEisley.logger = Logger.new(STDOUT)
MosEisley.logger.level = Logger::DEBUG
MosEisley::Config.setup do |c|
# User custom data
c.user = {my_data1: 'Something', my_data2: 'Somethingelse'}
# HTTP server (Sinatra) settings
c.dump_errors = true
c.logging = true
# Your handlers
c.handler_paths = [
'handlers'
]
# Slack info
c.verification_tokens = [
'vErIf1c4t0k3n5'
]
c.bot_access_token = 'xoxb-1234567890-b0t4cCe5sToK3N'
end
Use
To see help:
$ mos-eisley -h
Usage: mos-eisley [options] {start|stop}
-c, --config=<s> Load config from file
-d, --daemonize Run in the background
-l, --log=<s> Log output to file
-P, --pid=<s> Store PID to file
-p, --port=<i> Use port (default: 4567)
The minimum to start a server:
$ mos-eisley -c config.rb start