Skip to content

Commit

Permalink
fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
0x67757300 committed Dec 14, 2023
1 parent e7fa347 commit dbe3f9e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 21 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ _In µHTTP there is no hidden logic. Everything is what it seems._

### Why

- Stupid simple, seriously there are maybe 15 lines of "real" code in it. No external dependencies.
- Stupid simple, seriously there are maybe 15 lines of "real" code in it. _No external dependencies._
- Extremely modular, entire extensions can just follow the simple App pattern.
- Very flexible, `Response(Exception)`.
- Very flexible, because of decisions like being able to raise Responses.
- Quite fast, because it doesn't do much.
- Great learning device.

Expand Down Expand Up @@ -49,10 +49,10 @@ if __name__ == '__main__':

### API Reference

Personally, I recommend that you just read the source code.
An auto-generated reference can be found [here](https://0x67757300.github.io/uHTTP/uhttp.html).

However, an auto-generated reference can be found [here](https://0x67757300.github.io/uHTTP/uhttp.html).
Also, consider reading the source code, it should take all of 5 minutes.

### Tutorial

Coming soon...
_Coming soon..._
19 changes: 3 additions & 16 deletions uhttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,6 @@ class App:
"""An ASGI application.
Called once per request by the ASGI server.
Currently, doesn't support the WebSocket protocol. However, adding
support is easy:
```python
_app = App()
async def app(scope, receive, send):
if scope['type'] == 'websocket':
pass # WebSocket code goes here
else:
await _app(scope, receive, send)
```
"""

def __init__(
Expand Down Expand Up @@ -352,7 +339,7 @@ async def __call__(self, scope: dict, receive: Callable, send: Callable):


class Request:
"""A HTTP request."""
"""An HTTP request."""
method: str
path: str
params: dict[str, str]
Expand Down Expand Up @@ -394,7 +381,7 @@ def __repr__(self):


class Response(Exception):
"""A HTTP Response.
"""An HTTP Response.
They can be raised at any point for the early response pattern.
Expand Down Expand Up @@ -467,7 +454,7 @@ def from_any(cls, any: Any) -> 'Response':
async def asyncfy(func, /, *args, **kwargs):
"""Makes any function awaitable.
All synchronous code runs in a separate thread, so as to not block
All synchronous code runs in a separate thread, so as not to block
the main loop. As long as your code is thread-safe, things should
be fine. E.g. instead of opening one `sqlite3` connection at
startup, consider opening one for every request or just using
Expand Down

0 comments on commit dbe3f9e

Please sign in to comment.