domino logo
4.2
  • Overview
  • Domino Cloud
  • Get started
  • Work with data
  • Develop models
  • Scale out distributed computing
  • Deploy models
  • Publish Apps
  • Projects
  • Collaborate
  • Workspaces
  • Jobs
  • Environments
  • Executions
  • Launchers
  • Environment variables
  • Secure credential store
  • Organizations
  • Domino CLI
  • Troubleshooting
  • Get help
  • Additional resources
domino logo
About Domino
Domino Data LabKnowledge BaseData Science BlogTraining
>
User guide
>
Publish Apps
>
Host HTML pages

Host HTML pages

This is a simple example on how to host a HTML page on Domino. There are a number of ways to host web applications of course but this example shows how you can integrate a simple HTTP server using python with Domino. You could also add javascript and other pages to your project. The example in this note just shows how you would start the server to support your pages.

Files

You’ll need to create two files in your project (in addition to your files required for your page such as index.html).

app.sh

#!/usr/bin/env bash
python ./app.py

app.py

import http.server
import socketserver
PORT = 8888
Handler = http.server.SimpleHTTPRequestHandler
httpd = socketserver.TCPServer(("", PORT), Handler)
print ("serving at port", PORT)
httpd.serve_forever()

The app.sh file

When you publish an app, Domino looks for an app.sh file in your project to find the launch instructions. Aside from the app.sh file, Domino’s app development process mirrors standard development so your apps are portable and can be deployed elsewhere. Just include your app’s files in your Domino project.

When Domino launches your app, it runs the app.sh file within the container that contains your project files. The app.sh file must contain the commands to start the web hosting process.

Note

Publish the App

  1. Click Publish from the project sidebar.

  2. Give your app an informative title and description, and set permissions to Anyone can access. This allows anyone with a network connection to your Domino deployment to access the app if they have the URL.

    Tip

    App tab

  3. Click Publish.

  4. After the app status says "Running", click View App to load your App.

Domino Data Lab
Knowledge Base
Data Science Blog
Training
Copyright © 2023 Domino Data Lab. All rights reserved.