T1ckbase commited on
Commit
d6951de
·
1 Parent(s): e6e0669

write test

Browse files
Files changed (4) hide show
  1. .vscode/settings.json +6 -0
  2. Dockerfile +17 -0
  3. deno.json +12 -0
  4. main.ts +6 -0
.vscode/settings.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "deno.enable": true,
3
+ "deno.lint": true,
4
+ "editor.formatOnSave": true,
5
+ "editor.defaultFormatter": "denoland.vscode-deno"
6
+ }
Dockerfile ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM denoland/deno:latest
2
+
3
+ EXPOSE 7860
4
+
5
+ WORKDIR /app
6
+
7
+ # Prefer not to run as root.
8
+ USER deno
9
+
10
+ RUN deno install --entrypoint main.ts
11
+
12
+ COPY . .
13
+
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 ["run", "-A", "main.ts"]
deno.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "imports": {
3
+ },
4
+ "fmt": {
5
+ "indentWidth": 2,
6
+ "lineWidth": 69420,
7
+ "proseWrap": "preserve",
8
+ "semiColons": true,
9
+ "singleQuote": true,
10
+ "useTabs": false
11
+ }
12
+ }
main.ts ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ Deno.writeTextFileSync('test.txt', 'hello world');
2
+
3
+ Deno.serve({ port: 7860 }, (_req) => {
4
+ const text = Deno.readTextFileSync('test.txt');
5
+ return new Response(text);
6
+ });