-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
2,227 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"projects": { | ||
"default": "feast-server" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,111 +1,65 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
# Logs | ||
logs | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
firebase-debug.log* | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
# Firebase cache | ||
.firebase/ | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
# Firebase config | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
# Uncomment this if you'd like others to create their own Firebase project. | ||
# For a team working on the same Firebase project(s), it is recommended to leave | ||
# it commented so all members can deploy to the same project(s) in .firebaserc. | ||
# .firebaserc | ||
|
||
# PyBuilder | ||
target/ | ||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# pyenv | ||
.python-version | ||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# celery beat schedule file | ||
celerybeat-schedule | ||
# nyc test coverage | ||
.nyc_output | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Environments | ||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
|
||
# private keys | ||
credentials.json | ||
business.json | ||
ignore.txt | ||
.idea/ | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"hosting": { | ||
"public": "public", | ||
"ignore": [ | ||
"firebase.json", | ||
"**/.*", | ||
"**/node_modules/**" | ||
], | ||
"rewrites": [{ | ||
"source": "**", | ||
"function": "app" | ||
}] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules/ |
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"lowerCutOff": 41, | ||
"upperCutOff": 197 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
|
||
const classifier = require("./source/classifier"); | ||
const cutoffs = require("./files/CutOffs.json"); | ||
|
||
const functions = require('firebase-functions'); | ||
const express = require('express'); | ||
|
||
const app = express(); | ||
|
||
const PREFERENCE_QUERY_PARAMETER = 'classifiers'; | ||
|
||
app.get('/timestamp', (req, res) => { | ||
res.send(`${Date.now()}`); | ||
}); | ||
|
||
app.get('/setup', (req, res) => { | ||
let parameters = []; | ||
|
||
if(req.query[PREFERENCE_QUERY_PARAMETER] != null) { | ||
parameters = req.query[PREFERENCE_QUERY_PARAMETER]; | ||
console.log("Setup classifiers requested with " + parameters.length + " params"); | ||
} else { | ||
console.log("Setup classifiers requested"); | ||
} | ||
|
||
let picks = classifier.getInitialClassifiers(cutoffs, parameters); | ||
|
||
res.status(200).json(picks); | ||
}); | ||
|
||
app.get('/addon', (req, res) => { | ||
let parameters = []; | ||
|
||
if(req.query[PREFERENCE_QUERY_PARAMETER] == null) { | ||
console.log("Bad request query"); | ||
res.status(404).json('No preference specified'); | ||
return | ||
} else { | ||
parameters = req.query[PREFERENCE_QUERY_PARAMETER]; | ||
} | ||
|
||
if(parameters instanceof Array && parameters.length == 0) { | ||
res.status(404).json('Bad request query'); | ||
return; | ||
} | ||
|
||
if(parameters instanceof Array) | ||
parameters = parameters[0]; | ||
|
||
let errors = {}; | ||
console.log(`Add-on to ${parameters} requested`); | ||
const results = classifier.getSubsequentClassifiers(cutoffs, parameters, errors); | ||
|
||
if(results == null) { | ||
res.status(404).json(errors.message); | ||
return; | ||
} else { | ||
res.status(200).json(results); | ||
return; | ||
} | ||
}) | ||
|
||
app.get('/restaurants', (req, res) => { | ||
res.status(400).json('Route has been deprecated. Please use other map APIs for this feature'); | ||
}) | ||
|
||
exports.app = functions.https.onRequest(app); |
Oops, something went wrong.