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
@@ -166,6 +173,34 @@ The use of ETag is **not enabled by default**, this can be achieved with the `--
166
173
167
174
Typically, the entry point for web applications is the **index.htm or index.html** file. This does not need to be listed in the browser's address bar because web servers know that this file should be served by default. Svelteesp32 also does this: if there is an index.htm or index.html file, it sets it as the main file to be served. So using `http://esp_xxx.local` or just entering the `http://x.y.w.z/` IP address will serve this main file.
168
175
176
+
### C++ defines
177
+
178
+
To make it easy to integrate into a larger c++ project, we have made a couple of variables available as c++ defines.
179
+
180
+
You can use the COUNT and SIZE constants:
181
+
182
+
```c
183
+
...
184
+
#include"svelteesp32.h"
185
+
186
+
#if SVELTEESP32_COUNT != 5
187
+
#error Invalid file count
188
+
#endif
189
+
...
190
+
```
191
+
192
+
You can include a warning if a named file accidentally missing from the build:
193
+
194
+
```c
195
+
...
196
+
#include"svelteesp32.h"
197
+
198
+
#ifndef SVELTEESP32_FILE_index_html
199
+
#error Missing index file
200
+
#endif
201
+
...
202
+
```
203
+
169
204
### Command line options
170
205
171
206
| Option | Required | Description | default |
@@ -176,6 +211,7 @@ Typically, the entry point for web applications is the **index.htm or index.html
176
211
|`--etag`|| Use ETag header for cache | false |
177
212
|`--no-gzip`|| Do not compress content with gzip | false -> gzip used |
178
213
|`--espmethod`| x | Name of generated method |`initSvelteStaticFiles`|
214
+
|`--define`| x | Prefix of c++ defines |`SVELTEESP32`|
0 commit comments