File tree Expand file tree Collapse file tree 6 files changed +9
-13
lines changed Expand file tree Collapse file tree 6 files changed +9
-13
lines changed Original file line number Diff line number Diff line change 2020 - name : Setup Deno
2121 uses : denolib/setup-deno@master
2222 with :
23- deno-version : 0.x
23+ deno-version : 1.0.2
2424
2525 - name : Cache Deno Generated Files
2626 uses : actions/cache@v1
Original file line number Diff line number Diff line change 11RUNTIME custom
22
3- RUN mkdir -p /code/.fun/deno/bin
3+ ENV DENO_INSTALL /code/.fun/deno/
44
5- RUN cd /code/.fun/deno/bin \
6- && curl --fail --location --progress-bar --output deno.zip https://cdn.devtips.cn/deno/releases/v0.41.0/deno-x86_64-unknown-linux-gnu.zip \
7- && unzip -o deno.zip \
8- && chmod +x deno \
9- && rm deno.zip \
5+ RUN curl -fsSL https://x.deno.js.cn/install.sh | sh -s v1.0.2 \
106 && echo "Deno was installed successfully."
Original file line number Diff line number Diff line change 33[ ![ tag] ( https://img.shields.io/github/release/justjavac/deno_serverless_aliyun )] ( https://github.com/justjavac/deno_serverless_aliyun/releases )
44[ ![ Build Status] ( https://github.com/justjavac/deno_serverless_aliyun/workflows/ci/badge.svg?branch=master )] ( https://github.com/justjavac/deno_serverless_aliyun/actions )
55[ ![ license] ( https://img.shields.io/github/license/justjavac/deno_serverless_aliyun )] ( https://github.com/justjavac/deno_serverless_aliyun/blob/master/LICENSE )
6- [ ![ ] ( https://img.shields.io/badge/deno-v0.41.0 -green.svg )] ( https://github.com/denoland/deno )
6+ [ ![ ] ( https://img.shields.io/badge/deno-v1.0.2 -green.svg )] ( https://github.com/denoland/deno )
77
88Deno + Serverless = Awesome
99
Original file line number Diff line number Diff line change 11#! /bin/bash
2- deno -A server.js
2+ deno run -A --unstable server.js
Original file line number Diff line number Diff line change 11import {
22 ServerRequest ,
33 listenAndServe ,
4- } from "https://deno.land/std@v0.41 .0/http/server.ts" ;
4+ } from "https://deno.land/std@v0.53 .0/http/server.ts" ;
55
66async function handler ( req : ServerRequest ) : Promise < void > {
77 // 获取 request id
@@ -15,7 +15,7 @@ async function handler(req: ServerRequest): Promise<void> {
1515}
1616
1717// 从环境变量获取端口号
18- const port = Deno . env ( "FC_SERVER_PORT" ) ?? "9000" ;
18+ const port = Deno . env . get ( "FC_SERVER_PORT" ) ?? "9000" ;
1919
2020// 监听网络请求,并处理
2121listenAndServe ( `:${ port } ` , handler ) ;
Original file line number Diff line number Diff line change 1- import { assertEquals } from "https://deno.land/std/testing/asserts.ts" ;
1+ import { assertEquals } from "https://deno.land/std@v0.53.0 /testing/asserts.ts" ;
22
3- Deno . test ( function myTestFunction ( ) : void {
3+ Deno . test ( " myTestFunction" , ( ) : void => {
44 assertEquals ( "foo bar" , "foo bar" ) ;
55} ) ;
You can’t perform that action at this time.
0 commit comments