Skip to content

Commit

Permalink
Enhance web server section
Browse files Browse the repository at this point in the history
  • Loading branch information
mejroslav committed Aug 7, 2023
1 parent 5d4e565 commit 61cd891
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
17 changes: 9 additions & 8 deletions docs/reference/web/web-server.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# The web server
# Web server

ASAB provides a web server in a `asab.web` module.
This module offers an integration of [`aiohttp` web server](http://aiohttp.readthedocs.io/en/stable/web.html).
For starting, accessing and manipulating of a web server, ASAB provides `asab.web` module together with `asab.WebService` and `asab.web.WebContainer`.
This module offers an integration of [`aiohttp` web server](http://aiohttp.readthedocs.io/en/stable/web.html). It is possible to run multiple web servers from one application. The configuration for each server is stored in dedicated **web container**. **Web Service** registers these containers and runs the servers.

!!! tip

For a quick start, we recommend reading the official `aiohttp` tutorial on [how to run a simple web server](https://docs.aiohttp.org/en/stable/web_quickstart.html#run-a-simple-web-server).

In order to use ASAB Web Service, first make sure that you have `aiohttp` module installed:
``` shell
python3 -m pip install aiohttp
```

## Handlers, routes and resources

`aiohttp` servers use the concept of Handlers, Routes and Resources. Here we provide a very quick explanation that should help you to get into the terminology.
Expand All @@ -31,12 +36,8 @@ This module offers an integration of [`aiohttp` web server](http://aiohttp.readt
- **Resource** is an entry in route table which corresponds to requested URL. Resource in turn has at least one route. When you add a route, the resource object is created under the hood.


## Creating a web server
## Running a simple web server

First make sure that you have `aiohttp` module installed:
``` shell
python3 -m pip install aiohttp
```

!!! example "Creating a web server 1: One method does it all!"

Expand Down
10 changes: 5 additions & 5 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,16 +163,16 @@ nav:
- Application: reference/application/reference.md
- Modules and Services: reference/modules_services/reference.md

- Web Server:
- Creating a web server: reference/web/web-server.md
- Web Service:
- Web server: reference/web/web-server.md
- TLS/SSL: reference/web/tls.md
- Authorization and multitenancy: reference/web/authorization_multitenancy.md
- Cross-Origin Resource Sharing: reference/web/cors.md

- Configuration: reference/config/reference.md
- Logging: reference/logging/reference.md
- Library: reference/library/reference.md
- Metrics:
- Library Service: reference/library/reference.md
- Metrics Service:
- MetricsService: reference/metrics/service.md
- Gauge: reference/metrics/gauge.md
- Counter: reference/metrics/counter.md
Expand All @@ -183,7 +183,7 @@ nav:
- CounterWithDynamicTags: reference/metrics/counter_with_dynamic_tags.md
- AggregationCounterWithDynamicTags: reference/metrics/aggregation_counter_with_dynamic_tags.md
- HistogramWithDynamicTags: reference/metrics/histogram_with_dynamic_tags.md
- Storage:
- Storage Service:
- StorageService: reference/storage/service.md
- Upsertor: reference/storage/upsertor.md
- Exceptions: reference/storage/exceptions.md
Expand Down

0 comments on commit 61cd891

Please sign in to comment.