forked from serverless-dns/serverless-dns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run
executable file
·38 lines (34 loc) · 1.07 KB
/
run
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
31
32
33
34
35
36
37
38
#!/bin/sh
set -eu
banner() {
echo " __ __ _ __ __ ";
echo " ____ ___ / /_ / / (_)___ / /__ ___/ /___ ___";
echo " / __// -_)/ __// _ \ / // _ \ / '_// _ // _ \ (_-<";
echo "/_/ \__/ \__//_//_//_//_//_//_/\_\ \_,_//_//_//___/";
echo " ";
}
# this script is for development/test runs only
runtime="${1:-node}";
echo "run $runtime";
if [ $runtime = "deno" ] || [ $runtime = "d" ]; then
echo "using `which deno`";
banner
deno run --unstable \
--allow-env \
--allow-net \
--allow-read \
--import-map=import_map.json \
src/server-deno.ts;
elif [ $runtime = "workers" ] || [ $runtime = "w" ]; then
echo "using `which wrangler`";
banner
wrangler dev;
elif [ $runtime = "help" ] || [ $runtime = "h" ]; then
echo "note: make sure node / deno / wrangler are in path";
echo "usage: $0 [node|deno|workers]";
else
echo "note: nodejs v15+ required";
echo "using `which node`";
banner
node ./src/server-node.js;
fi