First, add MarkMapper to your Gemfile
, and run bundle install
:
gem 'mark_mapper'
If you’re not using Bundler.require
in the top of your Sinatra application then you’ll need to require the MarkMapper library:
require 'mark_mapper'
You’ll also need to set up your MarkLogic connection in your configure
method call.
configure do
MarkMapper.setup({
'production' => {
'host' => ENV['MARKLOGIC_HOST'],
'port' => ENV['MARKLOGIC_PORT']
}
}, 'production')
end
You can now define your models and start using MarkMapper in Sinatra!