2025-11-09 23:07:31 +01:00
|
|
|
# HelloWorld Example
|
2025-11-09 20:11:22 +01:00
|
|
|
|
2025-11-09 23:07:31 +01:00
|
|
|
This sample demonstrates a simple hello world application using Crafter.CppDOM.
|
|
|
|
|
|
2025-11-12 18:48:36 +01:00
|
|
|

|
|
|
|
|
|
2025-11-09 23:07:31 +01:00
|
|
|
## Usage
|
|
|
|
|
|
|
|
|
|
```cpp
|
|
|
|
|
import Crafter.CppDOM;
|
|
|
|
|
using namespace Crafter::CppDOM;
|
|
|
|
|
|
|
|
|
|
int main(){
|
|
|
|
|
HtmlElement body("body");
|
|
|
|
|
body.SetInnerHTML("Hello World!");
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Building and Running
|
2025-11-09 20:11:22 +01:00
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
crafter-build build executable
|
|
|
|
|
run.sh
|
|
|
|
|
```
|
|
|
|
|
|
2025-11-09 23:07:31 +01:00
|
|
|
Then navigate to `http://localhost:8080/` in your browser.
|
2025-11-09 20:11:22 +01:00
|
|
|
|
2025-11-09 23:07:31 +01:00
|
|
|
If caddy is not installed, you can use your favorite static file server instead.
|