puppeteer/packages/testserver
2023-09-19 10:57:38 +02:00
..
src chore: use @typescript-eslint/consistent-type-imports (#10913) 2023-09-15 13:00:20 +02:00
cert.pem chore: initiate monorepo migration (#9022) 2022-09-29 10:08:55 +02:00
CHANGELOG.md chore: release main (#9052) 2022-10-05 16:51:59 +02:00
key.pem chore: initiate monorepo migration (#9022) 2022-09-29 10:08:55 +02:00
LICENSE chore: initiate monorepo migration (#9022) 2022-09-29 10:08:55 +02:00
package.json chore: use -Xf instead of -Xdf (#10936) 2023-09-19 10:57:38 +02:00
README.md chore: initiate monorepo migration (#9022) 2022-09-29 10:08:55 +02:00
tsconfig.json chore: update dependencies (#10785) 2023-08-28 13:01:52 +02:00

TestServer

This test server is used internally by Puppeteer to test Puppeteer itself.

Example

const {TestServer} = require('@pptr/testserver');

(async(() => {
  const httpServer = await TestServer.create(__dirname, 8000),
  const httpsServer = await TestServer.createHTTPS(__dirname, 8001)
  httpServer.setRoute('/hello', (req, res) => {
    res.end('Hello, world!');
  });
  console.log('HTTP and HTTPS servers are running!');
})();