10e53439bSEben Haberecho off
20e53439bSEben Haber
30e53439bSEben Haberrem This script is used to launch a stand-alone program which supports a web-based query workbench
40e53439bSEben Haberrem for Couchbase on its HTTP listen port. It also supports a "describe" command, which samples 
50e53439bSEben Haberrem documents in a Couchbase bucket an infers a schema for them.
60e53439bSEben Haberrem
70e53439bSEben Haberrem Before running this script, you must "cd" to the directory where the script is located.
80e53439bSEben Haberrem
90e53439bSEben Haberrem The following variables should work for a basic install of Couchbase on the local machine.
100e53439bSEben Haberrem GUI_PORT is the port that you can go to with a web browser to see the GUI, e.g., http://localhost:8094
110e53439bSEben Haberrem COUCHBASE_URL is the URL you would go to to see the Couchbase web console
120e53439bSEben Haberrem USER and PASS and the administrator login/password for the Couchbase web console. You should
130e53439bSEben Haberrem  not need to set them unless you run into errors.
140e53439bSEben Haber
1502f4db42SEben M Haberset GUI_PORT=:8097
160e53439bSEben Haberset COUCHBASE_URL=http://127.0.0.1:8091
170e53439bSEben Haberset USER=
180e53439bSEben Haberset PASS=
195adca9c7SEben Haberset STATIC=./static/
200e53439bSEben Haber
210e53439bSEben Haberrem Check to make sure we are in the same directory as the necessary files
220e53439bSEben Haber
23dcbbceaeSEben Haberif not exist query-ui.exe (
24dcbbceaeSEben Haber    echo You must run this script in the same directory as query-ui.exe.
250e53439bSEben Haber    goto error
260e53439bSEben Haber)
270e53439bSEben Haber
280e53439bSEben Haberif not exist static (
290e53439bSEben Haber    echo You must run this script in the same directory as the static folder.
300e53439bSEben Haber    goto error
310e53439bSEben Haber)
320e53439bSEben Haber
330e53439bSEben Haberecho Go to %UI_SEVER_URL%/ui to use the query UI.
34dcbbceaeSEben Haberset COMMAND=query-ui.exe -datastore=%COUCHBASE_URL% -localPort=%GUI_PORT% -user=%USER% -pass=%PASS% -webcontent=%STATIC%
350e53439bSEben Haberecho Running: %COMMAND%
360e53439bSEben Haber%COMMAND%
370e53439bSEben Habergoto eof
380e53439bSEben Haber
390e53439bSEben Haber:error
400e53439bSEben Haberecho Failed with error %ERRORLEVEL%.
410e53439bSEben Haberexit /b %ERRORLEVEL%
420e53439bSEben Haber
430e53439bSEben Haber:eof
44