You can use Domino to host simple static web pages, such as HTML documents with optional JavaScript and CSS. This guide shows how to set up a lightweight Python server to serve your pages.
Next, add a lightweight Python server that can serve your HTML files when the App runs.
-
In the project sidebar, go to Code > Add File.
-
Name the file
app.py. -
Paste in the following code and save the file:
import http.server import socketserver PORT = 8888 Handler = http.server.SimpleHTTPRequestHandler httpd = socketserver.TCPServer(("", PORT), Handler) print("Serving at port", PORT) httpd.serve_forever()
This script runs a basic HTTP server on port 8888 that serves files from the project directory.
Now publish the project as a Domino App so your HTML page can be accessed through a browser.
-
In the project sidebar, go to Deployments > Apps.
-
Add a title and description for your App.
-
Set permissions.
-
(Optional) Define a custom URL path, such as
/apps/html-demo. -
Select
app.pyas the launch file. -
Click Publish.
Domino provisions the container, runs app.py, and makes your HTML page accessible at the App’s URL.
-
Apps in Domino gives an overview of how apps work within the Domino ecosystem.
-
Create and Publish an App has instructions on creating and publishing your Apps, customizing the App’s URL, and sharing Apps with authorized users.
-
Learn more about how Apps in Domino run and what identity and permissions are used.
