~hacktivista/leanweb

ref: 122ee2c848ec24bdd2f6c88172fb2cc1a1203959 leanweb/lib/leanweb.rb -rw-r--r-- 958 bytes
122ee2c8Felix Freeman Nested Controller#render 4 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# frozen_string_literal: true

# Copyright 2022 Felix Freeman <libsys@hacktivista.org>
#
# This file is part of "LeanWeb" and licensed under the terms of the Hacktivista
# General Public License version 0.1 or (at your option) any later version. You
# should have received a copy of this license along with the software. If not,
# see <https://hacktivista.org/licenses/>.

# LeanWeb is a minimal hybrid static / dynamic web framework.
module LeanWeb
  VERSION = '0.1.3'

  ROOT_PATH = ENV['LEANWEB_ROOT_PATH'] || Dir.pwd
  CONTROLLER_PATH = "#{ROOT_PATH}/src/controllers"
  VIEW_PATH = "#{ROOT_PATH}/src/views"
  PUBLIC_PATH = "#{ROOT_PATH}/public"

  MEDIA_EXTENSIONS = {
    nil => '.html',
    'application/javascript' => '.js',
    'application/json' => '.json',
    'text/html' => '.html',
    'text/plain' => '.txt'
  }.freeze

  autoload :Route, 'leanweb/route.rb'
  autoload :Controller, 'leanweb/controller.rb'
  autoload :App, 'leanweb/app.rb'
end