diff --git a/backend/Makefile b/backend/Makefile index 2581480..68dbeb1 100644 --- a/backend/Makefile +++ b/backend/Makefile @@ -3,10 +3,7 @@ default: ../brminv SCRP=$(shell chicken-install -repository) -#SCRP=$(shell ../cross-chicken-arm/bin/arm-chicken-install -repository) CSC=CHICKEN_REPOSITORY_PATH=../eggs:$(SCRP) csc -#CSC=CHICKEN_REPOSITORY_PATH=../eggs-arm:$(SCRP) ../cross-chicken-arm/bin/arm-csc -#CSC=../cross-chicken-arm/bin/arm-csc BRMINV_SOURCES=brminv.scm frontend.import.scm command-line.import.scm \ util-proc.import.scm duck.import.scm texts.import.scm diff --git a/backend/brminv.scm b/backend/brminv.scm index 93a501e..6da26c6 100644 --- a/backend/brminv.scm +++ b/backend/brminv.scm @@ -109,11 +109,20 @@ (print dbconn) (define (handle-api-calls) - #f) + (define plst (cdr (uri-path (request-uri (current-request))))) + (cond ((and (not (null? plst)) + (equal? (car plst) "api")) + (send-response #:body "API call") + #t) + (else + #f))) (handle-not-found (lambda (path) - (define upath (string-intersperse (map ->string (cdr (uri-path (request-uri (current-request))))) "/")) + (define upath + (string-intersperse + (map ->string (cdr (uri-path (request-uri (current-request))))) + "/")) (print 'log: upath) (cond ((equal? upath "") (send-response #:body (frontend-lookup "index.html"))) @@ -133,7 +142,6 @@ (when (not (handle-api-calls)) (send-response #:body (frontend-lookup "index.html")))))))))) -(debug-log (current-error-port)) (accept-loop listener (if ssl? ssl-accept diff --git a/tools/build-in-qemu.sh b/tools/build-in-qemu.sh new file mode 100644 index 0000000..a14913f --- /dev/null +++ b/tools/build-in-qemu.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +if [ -z "$1" ] ; then + echo "Usage: $0 password" + exit 1 +fi +PASS="$1" + +rsync -avr -e "sshpass -p$PASS ssh -p 2222" --exclude='*.import.scm' --exclude='*~' backend/*.scm backend/Makefile root@localhost:brminv/backend/ +rsync -avr -e "sshpass -p$PASS ssh -p 2222" frontend/dist/* root@localhost:brminv/frontend/dist/ +rsync -avr -e "sshpass -p$PASS ssh -p 2222" Makefile root@localhost:brminv/ +rsync -avr -e "sshpass -p$PASS ssh -p 2222" --exclude='*~' tools/* root@localhost:brminv/tools/ +sshpass -p$PASS ssh -p 2222 root@localhost 'make -C brminv' +sshpass -p$PASS scp -P 2222 root@localhost:brminv/brminv brminv-arm diff --git a/tools/schemify-tree.scm b/tools/schemify-tree.scm index 404fe25..07835e4 100644 --- a/tools/schemify-tree.scm +++ b/tools/schemify-tree.scm @@ -37,7 +37,10 @@ '() (cdr args))))) -(define args (get-argv)) +(define args0 (get-argv)) +(define args (if (null? args0) + '("../frontend/dist" "frontend" "frontend-lookup") + args0)) (when (< (length args) 1) (display "usage: schemify-tree dir") (newline)