- Notifications
You must be signed in to change notification settings - Fork0
frontend and backend of web app for designing walking tours
License
bandaloo/editour
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This is a tool to make it easier to define regions for the Kyoto VR tour app.
$ npm install$ npm start
Navigate tohttp://localhost:3000/
and upload some files. Then request them athttp://localhost:3000/tour/:name
(replace:name
with the name you input).
To run the server as a systemd service (recommended), copyeditour.service
to/lib/systemd/system/
. Then use systemctl to control it like so:
# systemctl enable editour# systemctl start editour
Now systemd will handle starting the server at startup and restarting it if itcrashes.
You can also run the server as a daemon usingforever.
Editautostart.sh
so that it points to the correct directory where index.jsis, then start the server with./autostart.sh start
and stop it with./autostart.sh stop
.
Use the Prettier code formatter when making PRs
We used mocha for testing. Make sure the server is running withnpm start
first, then runnpm test
and make sure all tests pass before pushing.
Caution: running the test suite will wipe out all tour zips and tempdirectories, so don't do it if you have anything important in there
Here is a list of API functions the backend handles. The response is usually aJSON like this:
{ "status": 400, "message": "Missing or invalid metadata field"}
The status is an HTTP status code like 200 or 404, and the message is a stringor stringified JSON that contains the data of the response.
Returns the metadata file of the most recent tour with the given name. Ifsuccessful, it returns a status of 200 and the stringified metadata as themessage. If no tour with the given name is found it returns 404, and if theserver encounters an internal error while processing the request it returns 500.
This is the only API endpoint for which the response is not a JSON. Instead, theresponse is the zip file of the most recent version of the tour with the givenname. Returns 404 if a tour with the given name isn't found or a 500 if there isan internal server error while processing the request.
Gets a list of unique tours on the server, returning a list of their names asthe message of its response. Returns 200 if successful or 500 if there is aninternal server error while processing the request.
Used for editing an existing tour. This request should contain the fieldstourName
,oldName
, andmetadata
, along with any number of files. Theserver will use the new metadata as well as the old and new files to create anew version of an existing tour. Returns 201 if the tour was editedsuccessfully, 400 if the request was invalid, 404 if the requested tour couldn'tbe found, or 500 if a server error occurred while processing the request.
Used for uploading a new tour. This request should include atourName
fieldand ametadata
field, along with any number of files. It verifies the uploadedtour and creates a zip for it on the server. Sends a 201 if the tour was createdsuccessfully, a 400 if the request is invalid, or a 500 if a server error isencountered.
Deletes all versions of the tour with the given name from the server. Returns200 if successful, along with a message saying how many versions were deleted,404 if no tour with that name could be found, or 500 if a server error wasencountered.
About
frontend and backend of web app for designing walking tours