Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Spot
spot-web-app
Commits
298ddbeb
Commit
298ddbeb
authored
Apr 19, 2021
by
Alexandre Duret-Lutz
Browse files
adjust api_endpoint to work on different ports
update the README to point to the docker container
parent
d9c75e57
Pipeline
#27494
passed with stage
in 1 minute and 58 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
README
View file @
298ddbeb
...
...
@@ -11,11 +11,12 @@ It's made of
Development
-----------
To start developping, first launch a server on localhost:5000 with
To start developping, first install Spot (see http://spot.lrde.epita.fr/instal.html)
with its Python bindings. Then launch an API server on localhost:5000 with
% server/spotapi.py
then
launch a client with
finally
launch a
web
client with
% cd client
% npm run start
...
...
@@ -24,6 +25,27 @@ Now any save to spotapi.py or client/src/LtlApp.js will cause these
components to reload automatically.
Using remotely or locally
-------------------------
This application is live at https://spot.lrde.epita.fr/app/
However this public server may be subject to occasional down time. If
you absolutely need the application for critical work (e.g, student
exam) you should run it locally on your own computer. This can be
done from git using the development instruction above, or more simply
by downloading a copy of the docker container that runs the Spot web
site:
sudo docker pull gitlab-registry.lrde.epita.fr/spot/spot-web
sudo docker run --rm=true -p 8080:80 gitlab-registry.lrde.epita.fr/spot/spot-web
The first command is optionnal and can be used to update an old local
copy of the container. The second command will run the container and
map its internal 80 port to 8080 on the local host, so you can point
your browser to localhost:8080/app/ to access the application.
Licenses
--------
...
...
client/.env.development
View file @
298ddbeb
REACT_APP_API_ENDPOINT = ':5000/api/'
REACT_APP_API_PORT = ':5000'
REACT_APP_API_ENDPOINT = '/api/'
client/.env.production
View file @
298ddbeb
REACT_APP_API_PORT = ''
REACT_APP_API_ENDPOINT = '/api/'
client/src/LtlApp.js
View file @
298ddbeb
...
...
@@ -319,10 +319,19 @@ function NoteText(props) {
}
function
api_endpoint
()
{
/* REACT_APP_API_ENDPOINT and REACT_APP_API_PORT are defined in
* files client/.env.{production,development}
*
* When developing, the API and web pages are running on different
* ports, but in production we assume they are served from the
* same server.
*/
return
(
window
.
location
.
protocol
+
"
//
"
+
window
.
location
.
hostname
+
(
process
.
env
.
REACT_APP_API_PORT
?
window
.
location
.
hostname
+
process
.
env
.
REACT_APP_API_PORT
:
window
.
location
.
host
)
+
process
.
env
.
REACT_APP_API_ENDPOINT
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment