new crafter.build structure
This commit is contained in:
parent
ad69ebeac8
commit
e35b7302cb
22 changed files with 83 additions and 109 deletions
12
examples/HelloElement/README.md
Normal file
12
examples/HelloElement/README.md
Normal file
|
|
@ -0,0 +1,12 @@
|
|||

|
||||
|
||||
This sample demonstrates how to use the element class
|
||||
|
||||
```bash
|
||||
crafter-build build executable
|
||||
run.sh
|
||||
```
|
||||
|
||||
and go to `http://localhost:8080/`
|
||||
|
||||
if caddy is not installed you can use your favorite static file server instead
|
||||
8
examples/HelloElement/main.cpp
Normal file
8
examples/HelloElement/main.cpp
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
import Crafter.CppDOM;
|
||||
using namespace Crafter::CppDOM;
|
||||
|
||||
int main(){
|
||||
HtmlElement body("body");
|
||||
body.SetInnerHTML("Hello World!");
|
||||
//No need to call FreeJs, this is done in the destructor of HtmlElement.
|
||||
}
|
||||
17
examples/HelloElement/project.json
Normal file
17
examples/HelloElement/project.json
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"name": "main",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "executable",
|
||||
"implementations": ["main"],
|
||||
"target": "wasm32-wasi",
|
||||
"debug" : true,
|
||||
"dependencies": [
|
||||
{
|
||||
"path":"../../project.json",
|
||||
"configuration":"lib-debug"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
1
examples/HelloElement/run.sh
Executable file
1
examples/HelloElement/run.sh
Executable file
|
|
@ -0,0 +1 @@
|
|||
caddy file-server --listen :8080 --root bin/executable
|
||||
Loading…
Add table
Add a link
Reference in a new issue