frames 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/usr/bin/ruby
  2. #
  3. # This file is part of CPEE-FRAMES.
  4. #
  5. # CPEE-FRAMES is free software: you can redistribute it and/or
  6. # modify it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation, either version 3 of the License, or (at your
  8. # option) any later version.
  9. #
  10. # CPEE-FRAMES is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
  13. # Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License along with
  16. # CPEE-FRAMES (file LICENSE in the main directory). If not, see
  17. # <http://www.gnu.org/licenses/>.
  18. if File.exist?(File.join(__dir__,'..','lib','cpee-frames','implementation.rb'))
  19. require_relative File.join(__dir__,'..','lib','cpee-frames','implementation')
  20. else
  21. require 'cpee-frames/implementation'
  22. end
  23. options = {
  24. :host => 'localhost',
  25. :port => 8305,
  26. :secure => false
  27. }
  28. Riddl::Server.new(CPEE::Frames::SERVER, options) do
  29. accessible_description true
  30. cross_site_xhr true
  31. @riddl_opts[:data_dir] ||= File.join(__dir__,'data')
  32. use CPEE::Frames::implementation(@riddl_opts)
  33. end.loop!