puppeteer/packages/testserver
jrandolf f42336cf83
feat: separate puppeteer and puppeteer-core (#9023)
This PR moves the puppeteer source code into separate mono-repo packages:

- `puppeteer` and `puppeteer-core` are now separated into their own
packages.
- `puppeteer-core` has a new exports called `puppeteer-core/internal`
for internal usage.

Tests and various tools have been updated to accommodate the migration.
2022-10-05 14:17:03 +02:00
..
src chore: initiate monorepo migration (#9022) 2022-09-29 10:08:55 +02:00
cert.pem chore: initiate monorepo migration (#9022) 2022-09-29 10:08:55 +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 feat: separate puppeteer and puppeteer-core (#9023) 2022-10-05 14:17:03 +02:00
README.md chore: initiate monorepo migration (#9022) 2022-09-29 10:08:55 +02:00
tsconfig.json chore: initiate monorepo migration (#9022) 2022-09-29 10:08:55 +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!');
})();