You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/getting_started/a_simple_webpage.md
+9-5Lines changed: 9 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
Hello World is a good start, but what if you want something a bit more fancy.. Something like an HTML document saying "Hello World". If that's what you want, follow along:
2
2
3
3
## Basic Webpage
4
-
Let's start our webpage with.. well.. a webpage. But before we create a webpage we need to place it somewhere Crow recognizes, for now this directory is going to be called `templates`, but we can [change it later](../../guides/templating/#page).
4
+
Let's start our webpage with.. well.. a webpage. But before we create a webpage we need to place it somewhere Crow recognizes, for now this directory is going to be called `templates`, but we can [change it later](../guides/templating.md#page).
5
5
6
6
Once our `templates` folder is created, we can create our HTML document inside it, let's call it `fancypage.html`.
7
7
@@ -80,13 +80,17 @@ Once the code is done compiling, if we call `http://localhost:18080/` we get our
80
80
81
81
!!! note
82
82
83
-
Compilation instructions are available for [Linux](../setup/linux#compiling-your-project), [MacOS](../setup/macos#compiling-using-a-compiler-directly), and [Windows](../setup/windows#getting-and-compiling-crow)
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.
123
127
2. We are using `load()` instead of `load_text()` since we have an actual variable now.
124
-
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.
128
+
3. We are creating a new [context](../guides/templating.md#context) containing the `person` variable from our template and the `name` we got from the URL.
125
129
4. We are using `render(ctx)` to apply our context to the template.
126
130
127
131
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!**
128
132
129
-
For more details on templates and HTML pages in Crow please go [here](../../guides/templating/)
133
+
For more details on templates and HTML pages in Crow please go [here](../guides/templating.md)
Copy file name to clipboardExpand all lines: docs/getting_started/setup/linux.md
+7-2Lines changed: 7 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,9 @@ You can also download the `crow_all.h` file and simply include that into your pr
45
45
46
46
!!! note
47
47
48
-
While building you can set the `CROW_FEATURES` variable (as a `;` separated list). You can use an argument such as `-DCROW_FEATURES="ssl;compression"`.
48
+
While building you can set:
49
+
the `CROW_ENABLE_SSL` variable to enable the support for https
50
+
the `CROW_ENABLE_COMPRESSION` variable to enable the support for http compression
49
51
50
52
!!! note
51
53
@@ -83,7 +85,10 @@ target_link_libraries(your_project PUBLIC Crow::Crow)
83
85
From there CMake should handle compiling and linking your project.
84
86
!!! note
85
87
86
-
For optional features like HTTP Compression or HTTPS you can set the `CROW_FEATURES` variable using lines such as `set(CROW_FEATURES "ssl;compression")`, `set(CROW_FEATURES ssl compression)`, or `set(CROW_FEATURES ssl)`.
88
+
For optional features like HTTP Compression or HTTPS you can set
89
+
90
+
the `CROW_ENABLE_SSL` variable to enable the support for https
91
+
the `CROW_ENABLE_COMPRESSION` variable to enable the support for http compression
Copy file name to clipboardExpand all lines: docs/getting_started/setup/macos.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,7 +61,10 @@ This will generate a `crow_all.h` file which you can use in the following steps
61
61
4.`make -j12`
62
62
!!! note
63
63
64
-
You can add options like `-DCROW_FEATURES="ssl;compression"` or `-DCROW_AMALGAMATE` to `cmake ..` to build optional tests/examples for HTTP Compression or HTTPS.
64
+
You can add options like `-DCROW_ENABLE_COMPRESSION=ON`
65
+
or `-DCROW_ENABLE_SSL=ON`
66
+
or `-DCROW_AMALGAMATE`
67
+
to `cmake ..` to build optional tests/examples for HTTP Compression or HTTPS.
Copy file name to clipboardExpand all lines: docs/getting_started/your_first_application.md
+6-3Lines changed: 6 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ int main()
16
16
}
17
17
```
18
18
The App (or SimpleApp) class organizes all the different parts of Crow and provides the developer (you) a simple interface to interact with these parts.
19
-
For more information, please go [here](../../guides/app).
19
+
For more information, please go [here](../guides/app.md).
20
20
21
21
## 3. Adding routes
22
22
Once you have your app, the next step is to add routes (or endpoints). You can do so with the `CROW_ROUTE` macro.
@@ -25,7 +25,7 @@ CROW_ROUTE(app, "/")([](){
25
25
return "Hello world";
26
26
});
27
27
```
28
-
For more details on routes, please go [here](../../guides/routes).
28
+
For more details on routes, please go [here](../guides/routes.md).
29
29
30
30
## 4. Running the app
31
31
Once you're happy with how you defined all your routes, you're going to want to instruct Crow to run your app. This is done using the `run()` method.
@@ -56,6 +56,9 @@ int main()
56
56
}
57
57
```
58
58
59
-
You then need to compile your code on your [Linux](../setup/linux#compiling-your-project), [MacOS](../setup/macos#compiling-using-a-compiler-directly), or [Windows](../setup/windows#getting-and-compiling-crow) machine
59
+
You then need to compile your code on your
60
+
[Linux](setup/linux.md#compiling-your-project),
61
+
[MacOS](setup/macos.md#compiling-using-a-compiler-directly), or
After building your `.cpp` file and running the resulting executable, you should be able to access your endpoint at [http://localhost:18080](http://localhost:18080). Opening this URL in your browser will show a white screen with "Hello world" typed on it.
0 commit comments