Commit 918ae503 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

add caching for succesfull requests and README for dev

parent 66ae10ca
This is a web application based on Spot. It offers some
tools to rewrite/study/compare/translate LTL formula.
It's made of
- a server-side API written in Python using Spot's Python
binding,
- a client-side web application written using ReactJS,
and calling that API.
To start developping, first launch a server on localhost:5000 with
% server/spotapi.py
then launch a client with
% cd client
% npm run start
Now any save to spotapi.py or client/src/LtlApp.js will cause these
components to reload automatically.
#!/usr/bin/python3
from flask import Flask, request from flask import Flask, request
from flask import __version__ as flask_version from flask import __version__ as flask_version
from flask.json import jsonify from flask.json import jsonify
...@@ -539,6 +541,17 @@ def compare(ltlformula, method='GET'): ...@@ -539,6 +541,17 @@ def compare(ltlformula, method='GET'):
return jsonify(result) return jsonify(result)
@app.after_request
def add_header(response):
if response.status_code == 200:
response.cache_control.max_age = 3600
return response
if __name__ == '__main__':
app.run(debug=True, use_reloader=True, use_debugger=False)
# import os # import os
# import sys # import sys
# #
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment