Preliminary static assets serving.
This commit is contained in:
		
							parent
							
								
									cd36a88d12
								
							
						
					
					
						commit
						03c744e9f1
					
				
					 1 changed files with 7 additions and 4 deletions
				
			
		|  | @ -23,10 +23,10 @@ | |||
| ;; CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||||
| ;; | ||||
| (import (chicken process-context) | ||||
| 	srfi-4 | ||||
| 	(chicken file) | ||||
| 	(chicken pathname) | ||||
| 	(chicken format)) | ||||
| 	(chicken format) | ||||
| 	(chicken io)) | ||||
| 
 | ||||
| (define (get-argv) | ||||
|   (let* ((args (argv)) | ||||
|  | @ -78,8 +78,11 @@ | |||
|       (if (null? tree) | ||||
| 	  alst | ||||
| 	  (let* ((fpath (car tree)) | ||||
| 		 (key (substring fpath dir-len)) | ||||
| 		 (value (with-input-from-file fpath read-u8vector))) | ||||
| 		 (key0 (substring fpath dir-len)) | ||||
| 		 (key (if (eq? (string-ref key0 0) #\/) | ||||
| 			  (substring key0 1) | ||||
| 			  key0)) | ||||
| 		 (value (with-input-from-file fpath read-string))) | ||||
| 	    (loop (cdr tree) | ||||
| 		  (cons (cons key value) | ||||
| 			alst))))))) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue