Stops the server.
(self)
| 241 | self.thread.start() |
| 242 | |
| 243 | def stop(self): |
| 244 | """Stops the server.""" |
| 245 | self.stop_serving = True |
| 246 | with contextlib.suppress(IOError): |
| 247 | _ = urllib_request.urlopen(f"http://{self.host}:{self.port}") |
| 248 | |
| 249 | def where_is(self, path, localhost=False) -> str: |
| 250 | # True force serve the page from localhost |