Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
fzumstein committed May 16, 2023
1 parent dd8f8c6 commit 01069ef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/pro/server/officejs_addins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ The backend exposes your Python functions by using a Python web framework: you n
# Return a JSON response
return JsonResponse(book.json())
.. caution:: To prevent a memory leak, it is important to close the book at the end of the request either by invoking ``book.close()`` or, as shown in the example, by using ``book`` as a context manager via the ``with`` statement.
.. caution:: To prevent a memory leak, it is important to close the book at the end of the request either by invoking ``book.close()`` or, as shown in the example, by using ``book`` as context manager via the ``with`` statement. Note that your framework may offer better means to automatically close the book at the end of a request via middleware or similar mechanism. As an example, for FastAPI, you can use dependency injection, see https://github.com/xlwings/xlwings-server-helloworld-fastapi.

Let's now move over to the frontend to learn how we can call these Python functions from the Office.js add-in!

Expand Down
2 changes: 1 addition & 1 deletion docs/pro/server/server.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ The backend exposes your Python functions by using a Python web framework. In mo
# Return a JSON response
return JSONResponse(book.json())
.. caution:: To prevent a memory leak, it is important to close the book at the end of the request either by invoking ``book.close()`` or, as shown in the example, by using ``book`` as a context manager via the ``with`` statement.
.. caution:: To prevent a memory leak, it is important to close the book at the end of the request either by invoking ``book.close()`` or, as shown in the example, by using ``book`` as context manager via the ``with`` statement. Note that your framework may offer better means to automatically close the book at the end of a request via middleware or similar mechanism. As an example, for FastAPI, you can use dependency injection, see https://github.com/xlwings/xlwings-server-helloworld-fastapi.

* For Desktop Excel, you can run the web server locally and call the respective function
* from VBA (requires the add-in installed or a workbook in standalone mode) or
Expand Down

0 comments on commit 01069ef

Please sign in to comment.