Commits

Greg Slepak committed bfd59dc

using real-path for WEB_ROOT instead of saved DOC_ROOT

  • Participants
  • Parent commits 4572f84

Comments (0)

Files changed (3)

File example-site/dragonfly-framework/config.lsp

 (constant (global 'DOCUMENT_ROOT) (env "DOCUMENT_ROOT"))
 ; dragonfly root
 (constant (global 'DRAGONFLY_ROOT) (string DOCUMENT_ROOT "/dragonfly-framework"))
+
 ; sync any customization of DOCUMENT_ROOT with the 'env'
-; don't modify these two lines
-(constant (global 'ORIGINAL_ROOT) (env "DOCUMENT_ROOT"))
+; don't modify this line
 (env "DOCUMENT_ROOT" DOCUMENT_ROOT)
 
 (context 'Dragonfly)

File example-site/dragonfly-framework/dragonfly.lsp

 [/text]
 )
 
-(set 'WEB_ROOT (slice DOCUMENT_ROOT (length ORIGINAL_ROOT)))
+(set 'WEB_ROOT (slice DOCUMENT_ROOT (length (real-path))))
 (push "/" WEB_ROOT -1)
 
 (context MAIN)

File example-site/dragonfly-framework/lib/response.lsp

 	(lookup file-extension extension-to-type-map)
 )
 
-(constant 'text-type "text/plain; charset=utf-8")
-(constant 'html-type "text/html; charset=utf-8")
-(constant 'xml-type "text/xml; charset=utf-8")
-(constant 'atom-type "application/atom+xml; charset=utf-8")
+(constant
+	'text-type "text/plain; charset=utf-8"  'xml-type "text/xml"
+	'html-type "text/html; charset=utf-8"   'js-type "application/javascript"
+	'atom-type "application/atom+xml"       'css-type "text/css"
+)
 
 (set 'extension-to-type-map
-  '((".html" html-type)
-	(".xml" xml-type)
-	(".rss" xml-type)
-	(".txt" text-type))
+  '((".html" html-type)  (".txt" text-type)
+	(".xml" xml-type)    (".js" js-type)   
+	(".rss" xml-type)    (".css" css-type))
 )
 
 ;===============================================================================