diff --git a/lib/plugin.js b/lib/plugin.js index 58cbdcc..ebb5cf8 100644 --- a/lib/plugin.js +++ b/lib/plugin.js @@ -28,17 +28,16 @@ export async function plugin (server, opts) { done(null, body) }) + const php = new Php({ + argv: process.argv, + docroot + }) + for (const method of HTTP_METHODS) { server.route({ method, url: '/*', handler: async (req, reply) => { - // TODO(mcollina): this should be cached outside - const php = new Php({ - argv: process.argv, - docroot - }) - const url = urlForRequest(req) // Php needs capitalized headers