# API


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

## [`serve_dev()`](https://ExploringML.github.io/fh-dev-utils/serve_dev.html#serve_dev)

The
[`serve_dev()`](https://ExploringML.github.io/fh-dev-utils/serve_dev.html#serve_dev)
function is a wrapper around the FastHTML `serve()` function, adding
utilities to enhance the development experience.

------------------------------------------------------------------------

<a
href="https://github.com/ExploringML/fh-dev-utils/blob/main/fh_dev_utils/serve.py#L12"
target="_blank" style="float:right; font-size:smaller">source</a>

### serve_dev

>  serve_dev (app='app', host='0.0.0.0', port=None, reload=True,
>                 reload_includes=None, reload_excludes=None, sqlite_port=8035,
>                 db=False, db_path='data/app.db', jupyter=False,
>                 jupyter_port=8036, tw=False, tw_src='./app.css',
>                 tw_dist='./public/app.css')

*Utility function to start FastHTML, TailwindCSS, Jupyter Lab, and
SQLite in development mode*

<table>
<colgroup>
<col style="width: 6%" />
<col style="width: 25%" />
<col style="width: 34%" />
<col style="width: 34%" />
</colgroup>
<thead>
<tr>
<th></th>
<th><strong>Type</strong></th>
<th><strong>Default</strong></th>
<th><strong>Details</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td>app</td>
<td>str</td>
<td>app</td>
<td>FastHTML (Starlette) class instance</td>
</tr>
<tr>
<td>host</td>
<td>str</td>
<td>0.0.0.0</td>
<td>Uvicorn host</td>
</tr>
<tr>
<td>port</td>
<td>NoneType</td>
<td>None</td>
<td>Uvicorn port</td>
</tr>
<tr>
<td>reload</td>
<td>bool</td>
<td>True</td>
<td>Uvicorn reload status</td>
</tr>
<tr>
<td>reload_includes</td>
<td>NoneType</td>
<td>None</td>
<td>Files to watch to reload Uvicorn</td>
</tr>
<tr>
<td>reload_excludes</td>
<td>NoneType</td>
<td>None</td>
<td>Files to exclude from watching to reload Uvicorn</td>
</tr>
<tr>
<td>sqlite_port</td>
<td>int</td>
<td>8035</td>
<td>sqlite-web port</td>
</tr>
<tr>
<td>db</td>
<td>bool</td>
<td>False</td>
<td>Enable SQLIte browser</td>
</tr>
<tr>
<td>db_path</td>
<td>str</td>
<td>data/app.db</td>
<td>SQLite database path</td>
</tr>
<tr>
<td>jupyter</td>
<td>bool</td>
<td>False</td>
<td>Enable Jupyter Lab</td>
</tr>
<tr>
<td>jupyter_port</td>
<td>int</td>
<td>8036</td>
<td>Jupyter Lab port</td>
</tr>
<tr>
<td>tw</td>
<td>bool</td>
<td>False</td>
<td>Enable TailwindCSS</td>
</tr>
<tr>
<td>tw_src</td>
<td>str</td>
<td>./app.css</td>
<td>TailwindCSS source file</td>
</tr>
<tr>
<td>tw_dist</td>
<td>str</td>
<td>./public/app.css</td>
<td>TailwindCSS output file</td>
</tr>
</tbody>
</table>

## [`cache_buster()`](https://ExploringML.github.io/fh-dev-utils/serve_dev.html#cache_buster)

It can be annoying sometimes when FastHTML live reload is enabled and
you’re quickly iterating on CSS changes and the styles sometimes get
cached between page loads. When this happens you have to manually clear
the browser cache and reload the page.

The
[`cache_buster()`](https://ExploringML.github.io/fh-dev-utils/serve_dev.html#cache_buster)
function adds a unique timestamp string to the CSS file added to the
site header which is different every page load, so this should eliminate
browser caching of CSS leading to a smoother development workflow.

------------------------------------------------------------------------

<a
href="https://github.com/ExploringML/fh-dev-utils/blob/main/fh_dev_utils/serve.py#L86"
target="_blank" style="float:right; font-size:smaller">source</a>

### cache_buster

>  cache_buster ()

*Helps to avoid browser caching of dynamically generated CSS during
development*
