Spaces:
Sleeping
Sleeping
T1ckbase
commited on
Commit
·
0da58fc
1
Parent(s):
f17e58b
use serve command
Browse files
Dockerfile
CHANGED
@@ -14,4 +14,4 @@ COPY . .
|
|
14 |
# Compile the main app so that it doesn't need to be compiled each startup/entry.
|
15 |
RUN deno cache main.ts
|
16 |
|
17 |
-
CMD ["
|
|
|
14 |
# Compile the main app so that it doesn't need to be compiled each startup/entry.
|
15 |
RUN deno cache main.ts
|
16 |
|
17 |
+
CMD ["serve", "-A", "--port", "7860", "serve.ts"]
|
deno.json
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
{
|
2 |
"tasks": {
|
3 |
-
"dev": "deno --allow-net --allow-read --allow-env --watch main.ts"
|
|
|
4 |
},
|
5 |
"imports": {
|
6 |
"@hono/hono": "jsr:@hono/hono@^4.7.1"
|
|
|
1 |
{
|
2 |
"tasks": {
|
3 |
+
"dev": "deno --allow-net --allow-read --allow-env --watch main.ts",
|
4 |
+
"serve": "deno serve --watch --port 7860 serve.ts"
|
5 |
},
|
6 |
"imports": {
|
7 |
"@hono/hono": "jsr:@hono/hono@^4.7.1"
|
main.ts
CHANGED
@@ -24,4 +24,5 @@ app.post('*', async (c) => {
|
|
24 |
});
|
25 |
});
|
26 |
|
27 |
-
Deno.serve({ port: 7860 }, app.fetch);
|
|
|
|
24 |
});
|
25 |
});
|
26 |
|
27 |
+
// Deno.serve({ port: 7860 }, app.fetch);
|
28 |
+
export default app.fetch;
|
serve.ts
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
import fetch from './main.ts';
|
2 |
+
|
3 |
+
export default { fetch };
|