This repository contains
- a basic entry/overview/landing web page template for a HAPI server (Demo) and
- code for a landing page with a advanced user interface for browsing servers and datasets, downloading data from your browser, generating ~10-line IDL/MATLAB/Python scripts to download data, and creating preview plots (Demo).
To use the basic landing page with your HAPI server, download single.htm and fill in the placeholders prefixed by
__, save as
index.htm and place in the directory associated with responses to the URL that ends in
To use the landing page with an advanced user interface,
git clone https://github.com/hapi-server/server-ui
or download and extract the zip archive of the code (and replace
server-ui-master in the following).
all.txt and copy the contents of
server-ui into your root HAPI server directory.
Or, for testing, edit edit
all.txt, cd to
server-ui, and execute
cd server-ui; python3 -m http.server # or cd server-ui; python2 -m SimpleHTTPServer # or cd server-ui; npm install; npm start
http://localhost:8000/ in a web browser.
By default, the list of servers at
http://localhost:8000/ will be that in https://github.com/hapi-server/servers/blob/master/all_.txt.
To use your own list, rename
all.txt and enter the URL of your HAPI server.
You can pass the URL of a server to create a menu for by passing it as a parameter in the hash. The following will cause the UI to show datasets in the SSCWeb HAPI server.
Several servers may be listed, e.g.,
Note that this will only work if the servers allow CORS.
If a server in
all.txt or the
server passed as a URL parameter does not allow CORS, you will need to use a proxy server to access resources from that server.
A very basic webserver with a proxy can be run on port
npm install npm run proxyserver # or npm install node proxy/proxy.js 8000
See the comments in
proxy/proxy.js to constrain URLs that can be proxied.
By default, if an request to
URL fails, an attempt to retrieve it is made via the proxy request
/proxy?url=URL. The URL for the proxy is set in the header of
Please submit issues and feature requests to the issue tracker.