Skip to content

Commit b37a7bb

Browse files
committed
Add more config options to cf worker tutorial
1 parent 24b7cdf commit b37a7bb

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/docs/grid-aware-websites/tutorials/grid-aware-tutorial-cloudflare-workers.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,27 @@ The worker we have setup will run on our assigned route, but it will just return
213213
<td>"none", "full", "headers", "logs"</td>
214214
<td>Activates debug mode which outputs logs and returns additional response headers.</td>
215215
</tr>
216+
<tr>
217+
<td><code>dev</code></td>
218+
<td>Boolean</td>
219+
<td><code>false</code></td>
220+
<td>true, false</td>
221+
<td>Enables development mode, which redirects requests to a local development server. </td>
222+
</tr>
223+
<tr>
224+
<td><code>devConfig</code></td>
225+
<td>Object</td>
226+
<td><code>{}</code></td>
227+
<td><code>{hostname: "localhost", port: "8080", protocol: "http"}</code></td>
228+
<td>Configuration options for the development mode, including hostname, port, and protocol.</td>
229+
</tr>
230+
<tr>
231+
<td><code>infoBarTarget</code></td>
232+
<td>String</td>
233+
<td>''</td>
234+
<td>Example: "header", "#info-container"</td>
235+
<td>CSS selector for the element where the <a href="https://github.com/thegreenwebfoundation/gaw-web-component">grid-aware info bar</a> will be inserted.</td>
236+
</tr>
216237
</tbody>
217238
</table>
218239
</div>
@@ -227,6 +248,8 @@ export default {
227248
return gridAwareAuto(request, env, ctx, {
228249
// Use this API key that has been saved as a secret
229250
gawDataApiKey: env.EMAPS_API_KEY,
251+
// A CSS selector for the element where the grid-aware info bar will be inserted.
252+
infoBarTarget: "#gaw-info-bar",
230253
debug: "full",
231254
// Make these changes to the web page using HTMLRewriter
232255
htmlChanges: new HTMLRewriter().on("html", {

0 commit comments

Comments
 (0)