fastify-http-proxy
Advanced tools
Comparing version 0.1.1 to 0.2.0
@@ -36,2 +36,3 @@ 'use strict' | ||
await server.listen(3000) | ||
return server | ||
} | ||
@@ -38,0 +39,0 @@ |
@@ -16,5 +16,8 @@ 'use strict' | ||
fastify.addContentTypeParser('*', function (req, done) { | ||
fastify.addContentTypeParser('application/json', bodyParser) | ||
fastify.addContentTypeParser('*', bodyParser) | ||
function bodyParser (req, done) { | ||
done(null, req) | ||
}) | ||
} | ||
@@ -25,5 +28,5 @@ fastify.all('/', { beforeHandler }, reply) | ||
function reply (request, reply) { | ||
const dest = request.req.url.replace(this.basePath, '') | ||
var dest = request.raw.url.replace(this.basePath, '') | ||
reply.from(dest) | ||
} | ||
} |
{ | ||
"name": "fastify-http-proxy", | ||
"version": "0.1.1", | ||
"version": "0.2.0", | ||
"description": "proxy http requests, for Fastify", | ||
@@ -25,3 +25,3 @@ "main": "index.js", | ||
"devDependencies": { | ||
"fastify": "^1.0.0-rc.1", | ||
"fastify": "^1.0.0-rc.2", | ||
"got": "^8.0.3", | ||
@@ -28,0 +28,0 @@ "http-errors": "^1.6.2", |
8292
159