Skip to content
This repository was archived by the owner on Sep 9, 2025. It is now read-only.

Commit 1db569d

Browse files
authored
Update documentation and clean packages (#5)
1 parent f426ca2 commit 1db569d

File tree

5 files changed

+52
-5
lines changed

5 files changed

+52
-5
lines changed

package-lock.json

Lines changed: 40 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"dependencies": {
3333
"@supabase/supabase-js": "^1.27.0",
3434
"crossroads": "^0.12.2",
35+
"encoding": "^0.1.13",
3536
"fs-extra": "^10.0.0"
3637
}
3738
}

src/api/todos.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ const {
1313
} = require("../lib/responses");
1414
const { ErrorType } = require('../lib/errors');
1515
const db = require("../lib/supadb");
16+
17+
/**
18+
* When using redirect rules to change './netlify/functions'
19+
* to '/api' this function path will need to be updated. I
20+
* would suggest driving the base path of the function from
21+
* an environment variable. Default to './netlify/functions'
22+
* for local testing.
23+
*/
1624
const FUNCTION_PATH = "/.netlify/functions/todos";
1725

1826
const handler = async (request, _context) => {

src/img/netlify-environment.PNG

26.7 KB
Loading

src/lib/errors.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ const ErrorType = {
44
PATH_NOT_FOUND: "PathNotFound",
55
}
66

7-
module.exports = { ErrorType }
7+
module.exports = {
8+
ErrorType,
9+
};

0 commit comments

Comments
 (0)