vercel-deno-dev
Advanced tools
Comparing version 0.1.0-b502460c508a10a39f234dbe5984c6645e1455b2 to 0.1.0-b5dcd8bc2ade4c4f4ff1003655ac40ddfdd7d7cb
@@ -52,2 +52,5 @@ import * as base64 from 'https://deno.land/x/base64/mod.ts'; | ||
const output = new Deno.Buffer(); | ||
output.grow(33554432); // Initialize memory size to 2^25 ~~ 33.5 MB | ||
// Default buffer size: 4096 Bytes. | ||
const req:NowRequest = new ServerRequest(); | ||
@@ -88,11 +91,10 @@ req.r = new BufReader(input); | ||
// The actual output is raw HTTP message, | ||
// so we will parse it | ||
// - Headers ( statuscode default to 200 ) | ||
// - Message | ||
const bufr = new BufReader(output); | ||
// TODO: dynamically determine buffer size. | ||
// output.length has a mismatch size of a few hundret bytes compared to boy.bytlength. | ||
// not including size argument will make bufReader use default size 4096 Bytes. | ||
// console.log({outlen:output.length}) | ||
const bufr = new BufReader(output,output.length); | ||
const tp = new TextProtoReader(bufr); | ||
const firstLine = await tp.readLine() || 'HTTP/1.1 200 OK'; // e.g. "HTTP/1.1 200 OK" | ||
const firstLine = await tp.readLine() || 'HTTP/2.0 200 OK'; // e.g. "HTTP/1.1 200 OK" | ||
const statuscode = res ? res.status || 200 : parseInt(firstLine.split(' ', 2)[1], 10); // get statuscode either from res or req. | ||
@@ -105,6 +107,10 @@ const headers = await tp.readMIMEHeader() || new Headers(); | ||
let body = new Uint8Array(bufr.buffered()); | ||
let read = await bufr.readFull(body); | ||
let buff = new Uint8Array(bufr.size()); | ||
const size = await bufr.read(buff)||bufr.size(); | ||
const body = buff.slice(0,size); | ||
if (!body) throw new Deno.errors.UnexpectedEof(); | ||
// console.log({ | ||
// outlen:output.length, | ||
// bodylen:body.byteLength, | ||
// }) | ||
await req.finalize(); | ||
@@ -128,3 +134,3 @@ | ||
console.log("invoke Response") | ||
console.log({result,context}) | ||
console.log({result}) | ||
const res = await LambdaFetch(`invocation/${context.awsRequestId}/response`, { | ||
@@ -131,0 +137,0 @@ method: 'POST', |
{ | ||
"name": "vercel-deno-dev", | ||
"version": "0.1.0-b502460c508a10a39f234dbe5984c6645e1455b2", | ||
"version": "0.1.0-b5dcd8bc2ade4c4f4ff1003655ac40ddfdd7d7cb", | ||
"description": "run deno on vercel", | ||
@@ -9,6 +9,4 @@ "main": "./dist/index", | ||
"dependencies": { | ||
"@vercel/build-utils": "^2.3.1", | ||
"fs-extra": "^9.0.1", | ||
"which": "^2.0.2", | ||
"execa": "4.0.2" | ||
"execa": "4.0.2", | ||
"fs-extra": "^9.0.1" | ||
}, | ||
@@ -20,5 +18,5 @@ "files": [ | ||
"devDependencies": { | ||
"@vercel/build-utils": "^2.3.1", | ||
"@types/fs-extra": "^9.0.1", | ||
"@types/node": "^14.0.1", | ||
"@types/which": "^1.3.2", | ||
"@vercel/frameworks": "^0.0.14", | ||
@@ -29,5 +27,7 @@ "@vercel/routing-utils": "^1.8.2", | ||
"scripts": { | ||
"build": "tsc && cp -R ./src/boot/ ./dist/boot/", | ||
"test": "rmdir /s /q .\\test\\dist_ress\\ || tsc --project ./test/tsconfig.json && node ./test/dist_ress/test.js" | ||
"clean": "if exist .\\dist\\ ( rmdir /s/q .\\dist\\ )", | ||
"build:win": "tsc && (robocopy .\\src\\boot .\\dist\\boot\\ * /s) ^& IF %ERRORLEVEL% LSS 8 SET ERRORLEVEL = 0", | ||
"build": "tsc && cp -R ./src/boot/. ./dist/boot/", | ||
"publish:win": "npm run clean && npm run build:win" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23029
2
14
511
53
- Removed@vercel/build-utils@^2.3.1
- Removedwhich@^2.0.2
- Removed@vercel/build-utils@2.17.0(transitive)