Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor updates to docs #646

Merged
merged 6 commits into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/getting_started/a_simple_webpage.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ int main()
}
```

1. We are adding a `string` variable to the URL and a counterpart (`std::string name`) to our Route, this can be anything the user wants.
1. We are adding a `string` variable to the URL and a counterpart (`std::string name`) to our route - this can be anything the user wants.
2. We are using `load()` instead of `load_text()` since we have an actual variable now.
3. We are creating a new [context](../../guides/templating/#context) containing the `person` variable from our template and the `name` we got from the URL.
4. we are using `render(ctx)` to apply our context to the template.
4. We are using `render(ctx)` to apply our context to the template.

Now (after compiling the code and running the executable a second time) calling `http://localhost:18080/Bob` should return a webpage containing "Hello Bob!". **We did it!**

Expand Down
2 changes: 2 additions & 0 deletions docs/getting_started/setup/macos.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,5 @@ g++ main.cpp -lpthread
You'll need to install GCC via `brew install gcc`. the Clang compiler should be part of XCode or XCode command line tools.

You can use arguments like `-DCROW_ENABLE_DEBUG`, `-DCROW_ENABLE_COMPRESSION -lz` for HTTP Compression, or `-DCROW_ENABLE_SSL -lssl` for HTTPS support, or even replace g++ with clang++.

If GCC throws errors and your program does not compile, you may be using C++03 instead of ≥C++11. Use the flag `-std=c++11`.
2 changes: 1 addition & 1 deletion docs/getting_started/your_first_application.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Once you're happy with how you defined all your routes, you're going to want to
``` cpp
app.port(18080).multithreaded().run();
```
Please note that the `port()` and `multithreaded()` methods aren't needed, Though not using `port()` will cause the default port (`80`) to be used.<br>
Please note that the `port()` and `multithreaded()` methods aren't needed, though not using `port()` will cause the default port (`80`) to be used.<br>

## Putting it all together

Expand Down
6 changes: 3 additions & 3 deletions docs/guides/blueprints.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<span class="tag">[:octicons-feed-tag-16: v1.0](https://github.com/CrowCpp/Crow/releases/v1.0)</span>


Crow supports flask style blueprints.<br>
A blueprint is a limited app. It cannot handle networking. But it can handle routes.<br>
Blueprints allow developers to compartmentalize their Crow applications, making them a lot more modular.<br><br>
Crow supports Flask-style blueprints.<br>
A blueprint is a limited app. It cannot handle networking, but it can handle routes.<br>
Blueprints allow developers to compartmentalize their Crow applications, making them much more modular.<br><br>

In order for a blueprint to work, it has to be registered with a Crow app before the app is run. This can be done using `#!cpp app.register_blueprint(blueprint);`.<br><br>

Expand Down
4 changes: 2 additions & 2 deletions docs/guides/logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Crow comes with a simple and easy to use logging system.<br><br>
## Setting up logging level
You can set up the level at which crow displays logs by using the app's `loglevel(crow::LogLevel)` method.<br><br>

The available log levels are as follows (please not that setting a level will also display all logs below this level):
The available log levels are as follows (please note that setting a level will also display all logs below this level):

- Debug
- Info
Expand All @@ -28,7 +28,7 @@ Writing a log is as simple as `#!cpp CROW_LOG_<LOG LEVEL> << "Hello";` (replace&

!!! note

Log times are reported in GMT timezone by default. This is because HTTP requires all reported times for requests and responses to be in GMT. This can be changed by using the macro `CROW_USE_LOCALTIMEZONE` which will set **only the log timezone** to the server's local timezone.
Log times are reported in UTC timezone by default. This is because HTTP requires all reported times for requests and responses to be in UTC. This can be changed by using the macro `CROW_USE_LOCALTIMEZONE` which will set **only the log timezone** to the server's local timezone.
robertgodfrey marked this conversation as resolved.
Show resolved Hide resolved

## Creating A custom logger
<span class="tag">[:octicons-feed-tag-16: v1.0](https://github.com/CrowCpp/Crow/releases/v1.0)</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/static.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

A static file is any file that resides in the server's storage.

Crow supports returning Static files as responses in 2 ways.
Crow supports returning static files as responses either implicitly or explicitly.

## Implicit
Crow implicitly returns any static files placed in a `static` directory and any subdirectories, as long as the user calls the endpoint `/static/path/to/file`.<br><br>
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/websockets.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Websockets are a way of connecting a client and a server without the request response nature of HTTP.<br><br>
Websockets are a way of connecting a client and a server without the request response nature of HTTP.<br>
robertgodfrey marked this conversation as resolved.
Show resolved Hide resolved

## Routes
To create a websocket in Crow, you need a websocket route.<br>
A websocket route differs from a normal route quite a bit. It uses A slightly altered `CROW_WEBSOCKET_ROUTE(app, "/url")` macro, which is then followed by a series of methods (with handlers inside) for each event. These are (sorted by order of execution):
A websocket route differs from a normal route quite a bit. It uses a slightly altered `CROW_WEBSOCKET_ROUTE(app, "/url")` macro, which is then followed by a series of methods (with handlers inside) for each event. These are (sorted by order of execution):


- `#!cpp onaccept([&](const crow::request& req, void** userdata){handler code goes here})`
Expand Down
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ nav:
- MacOS: getting_started/setup/macos.md
- Windows: getting_started/setup/windows.md
- Your First Application: getting_started/your_first_application.md
- A simple Webpage: getting_started/a_simple_webpage.md
- A Simple Webpage: getting_started/a_simple_webpage.md
- Guides:
- Different parts of Crow:
- App: guides/app.md
Expand Down