This tutorial will show you how to share a simple static webapp composed of one HTML, one CSS, and one JavaScript file.
You will also learn how to make this webapp public so you can share it with users without requiring Dataiku authentication.
It is time to add the code of your static webapp.
For this tutorial, you will create a webapp that displays the content of a CSV file you can choose.
Download and paste each code content in the corresponding tab. All the code is also available at the end of this tutorial.
The next steps in this tutorial will use 2 identifiers: your Project key and your webapp ID.
When editing your webapp, your URL will look like https://<DataikuinstanceURL>/projects/<MY_PROJECT_KEY>/webapps/<webappId>_<webappname>/edit.
Please take notes of:
your Project key: this is the complete sequence of characters between projects/ and /webapps in the URL.
your webapp ID: it is the first 8 characters (before the underscore) in the URL
For example, if your URL is https://dataiku.mycompany.com/projects/STATIC_PROJECT/webapps/yW1w30l_staticapp/edit, the identifiers are:
- Project key: STATIC_PROJECT
- webapp ID: yW1w30l
To allow public use, you will first need to add your webapp to a whitelist on your instance.
In your Dataiku instance, choose Administration from the Applications menu.
Navigate to the Settings tab.
Select the Other security settings, in the SECURITY & AUDIT section, then click on the Webapps link.
The Webapps section of the settings includes a dedicated Public Webapps area, and clicking the + ADD VALUE button registers your webapp in the whitelist of your instance.
As indicated, the webapp is identified by a key composed of the Project key and the webapp ID. You will find this information in your Dataiku URL.
To whitelist your webapp, use the value MY_PROJECT_KEY.webappId and click on the SAVE button.
To serve your webapp to public users, you need to enable the Python backend.
Navigate to the Python tab.
Click on the Enable link.
Leave the Python code tab empty. Your static webapp is now accessible to any public user.
The URL to access the webapp will be, for example: https://<DataikuinstanceURL>/webapps/<MY_PROJECT_KEY>/<webappId>/
<mainclass="app"><sectionclass="toolbar"aria-labelledby="page-title"><div><pclass="eyebrow">Show CSV content</p><h1id="page-title">CSV file reader</h1></div><labelclass="file-button"><inputid="csv-file"type="file"accept=".csv,text/csv">
Choose a CSV file
</label></section><sectionid="drop-zone"class="drop-zone"><p>Drop a CSV file here, or use the file picker.</p><small>The first row is used as the table header.</small></section><sectionid="status"class="status"role="status"aria-live="polite">
No file loaded.
</section><sectionclass="table-shell"aria-label="CSV data"><tableid="csv-table"></table></section></main>