Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit 42ba3b5

Browse files
committed
Adding serverless backend
1 parent 768f772 commit 42ba3b5

36 files changed

+4535
-0
lines changed

api/.jshintignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
dist/**/*
2+
lambda/authorizer.js
3+
lambda/node_modules/**/*
4+
node_modules/**/*
5+
npm-debug.log
6+
later/**

api/.jshintrc

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
{
2+
// JSHint Default Configuration File (as on JSHint website)
3+
// See http://jshint.com/docs/ for more details
4+
5+
"maxerr" : 5, // {int} Maximum error before stopping
6+
7+
// Enforcing
8+
"bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.)
9+
"camelcase" : true, // true: Identifiers must be in camelCase
10+
"curly" : true, // true: Require {} for every new block or scope
11+
"eqeqeq" : true, // true: Require triple equals (===) for comparison
12+
"forin" : false, // true: Require filtering for..in loops with obj.hasOwnProperty()
13+
"freeze" : true, // true: prohibits overwriting prototypes of native objects such as Array, Date etc.
14+
"immed" : false, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());`
15+
"latedef" : false, // true: Require variables/functions to be defined before being used
16+
"newcap" : true, // true: Require capitalization of all constructor functions e.g. `new F()`
17+
"noarg" : true, // true: Prohibit use of `arguments.caller` and `arguments.callee`
18+
"noempty" : true, // true: Prohibit use of empty blocks
19+
"nonbsp" : true, // true: Prohibit "non-breaking whitespace" characters.
20+
"nonew" : false, // true: Prohibit use of constructors for side-effects (without assignment)
21+
"plusplus" : false, // true: Prohibit use of `++` and `--`
22+
"quotmark" : false, // Quotation mark consistency:
23+
// false : do nothing (default)
24+
// true : ensure whatever is used is consistent
25+
// "single" : require single quotes
26+
// "double" : require double quotes
27+
"undef" : true, // true: Require all non-global variables to be declared (prevents global leaks)
28+
"unused" : true, // Unused variables:
29+
// true : all variables, last function parameter
30+
// "vars" : all variables only
31+
// "strict" : all variables, all function parameters
32+
"strict" : true, // true: Requires all functions run in ES5 Strict Mode
33+
"maxparams" : false, // {int} Max number of formal params allowed per function
34+
"maxdepth" : false, // {int} Max depth of nested blocks (within functions)
35+
"maxstatements" : false, // {int} Max number statements per function
36+
"maxcomplexity" : false, // {int} Max cyclomatic complexity per function
37+
"maxlen" : 150, // {int} Max number of characters per line
38+
"varstmt" : false, // true: Disallow any var statements. Only `let` and `const` are allowed.
39+
40+
// Relaxing
41+
"asi" : true, // true: Tolerate Automatic Semicolon Insertion (no semicolons)
42+
"boss" : false, // true: Tolerate assignments where comparisons would be expected
43+
"debug" : false, // true: Allow debugger statements e.g. browser breakpoints.
44+
"eqnull" : false, // true: Tolerate use of `== null`
45+
"es5" : false, // true: Allow ES5 syntax (ex: getters and setters)
46+
"esnext" : true, // true: Allow ES.next (ES6) syntax (ex: `const`)
47+
"moz" : false, // true: Allow Mozilla specific syntax (extends and overrides esnext features)
48+
// (ex: `for each`, multiple try/catch, function expression…)
49+
"evil" : false, // true: Tolerate use of `eval` and `new Function()`
50+
"expr" : false, // true: Tolerate `ExpressionStatement` as Programs
51+
"funcscope" : false, // true: Tolerate defining variables inside control statements
52+
"globalstrict" : true, // true: Allow global "use strict" (also enables 'strict')
53+
"iterator" : false, // true: Tolerate using the `__iterator__` property
54+
"lastsemic" : false, // true: Tolerate omitting a semicolon for the last statement of a 1-line block
55+
"laxbreak" : false, // true: Tolerate possibly unsafe line breakings
56+
"laxcomma" : false, // true: Tolerate comma-first style coding
57+
"loopfunc" : false, // true: Tolerate functions being defined in loops
58+
"multistr" : false, // true: Tolerate multi-line strings
59+
"noyield" : false, // true: Tolerate generator functions with no yield statement in them.
60+
"notypeof" : false, // true: Tolerate invalid typeof operator values
61+
"proto" : false, // true: Tolerate using the `__proto__` property
62+
"scripturl" : false, // true: Tolerate script-targeted URLs
63+
"shadow" : false, // true: Allows re-define variables later in code e.g. `var x=1; x=2;`
64+
"sub" : false, // true: Tolerate using `[]` notation when it can still be expressed in dot notation
65+
"supernew" : false, // true: Tolerate `new function () { ... };` and `new Object;`
66+
"validthis" : false, // true: Tolerate using this in a non-constructor function
67+
68+
// Environments
69+
"browser" : true, // Web Browser (window, document, etc)
70+
"browserify" : false, // Browserify (node.js code in the browser)
71+
"couch" : false, // CouchDB
72+
"devel" : false, // Development/debugging (alert, confirm, etc)
73+
"dojo" : false, // Dojo Toolkit
74+
"jasmine" : false, // Jasmine
75+
"jquery" : false, // jQuery
76+
"mocha" : true, // Mocha
77+
"mootools" : false, // MooTools
78+
"node" : true, // Node.js
79+
"nonstandard" : false, // Widely adopted globals (escape, unescape, etc)
80+
"phantom" : false, // PhantomJS
81+
"prototypejs" : false, // Prototype and Scriptaculous
82+
"qunit" : false, // QUnit
83+
"rhino" : false, // Rhino
84+
"shelljs" : false, // ShellJS
85+
"typed" : false, // Globals for typed array constructions
86+
"worker" : false, // Web Workers
87+
"wsh" : false, // Windows Scripting Host
88+
"yui" : false, // Yahoo User Interface
89+
90+
// Custom Globals
91+
"globals" : {} // additional predefined global variables
92+
}

api/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# spacefinder-api
2+
3+
lambda/data
4+
5+
Contains base class for tables with LocationTable extending this class. These classes and methods are wrappers to DynamoDB calls.
6+
7+
```
8+
gulp create_tables
9+
```
10+
will create any defined table
11+
12+
In order to have prefix, config.js will contain the prefix for resources.
13+
14+
lambda/index.js
15+
16+
These are the handlers of the lambda functions which expose a CRUD interface
17+
on the resources.
18+
19+
There is a test on
20+
21+
test/lambda/locations.spec.js
22+
23+
To run the tests
24+
25+
```
26+
mocha **/*.spec.js
27+
```
28+
29+
This will run all tests, all tests end in *.spec.js

0 commit comments

Comments
 (0)