summaryrefslogtreecommitdiffstats
path: root/remote/test/puppeteer/utils/testserver/README.md
blob: d22b2da4492c7faa3d7444d2871ae59f00085539 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# TestServer

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

### Example

```ts
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!');
})();
```