get tests passing in the browser

This commit is contained in:
ennmichael
2023-04-05 16:00:36 +02:00
parent b650a1684f
commit 2544d79975
21 changed files with 495 additions and 50 deletions

View File

@ -0,0 +1,4 @@
# An nginx proxy which adds "Access-Control-Allow-Origin: *" to responses.
FROM nginx
COPY config.sh /docker-entrypoint.d/

View File

@ -0,0 +1,24 @@
echo "\
map \$http_upgrade \$connection_upgrade {\
default upgrade;\
'' close;\
}\
\
proxy_read_timeout 600s;\
\
server {\
listen 80;\
server_name default;\
\
location / {\
proxy_pass http://$TARGET;\
proxy_http_version 1.1;\
proxy_set_header Upgrade \$http_upgrade;\
proxy_set_header Connection \$connection_upgrade;\
# The NIP defines that the relay should return Access-Control-Allow-Origin: * here, so don't do it twice.\n\
if (\$http_accept != 'application/nostr+json') {\
add_header 'Access-Control-Allow-Origin' '*';\
}\
}\
}" > /etc/nginx/conf.d/default.conf
cat /etc/nginx/conf.d/default.conf

View File

@ -1 +1,2 @@
Dockerfile
node_modules/

View File

@ -5,6 +5,7 @@ RUN apt-get update && apt-get install -y curl nodejs npm
RUN npm i -g yarn
EXPOSE 8000
EXPOSE 8080
COPY . .
USER $APP_USER