-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Netlify functions example #11892
Netlify functions example #11892
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bunch of comments. Also, let's add some test cases.
examples/netlify-functions/functions/getProducts/getProducts.js
Outdated
Show resolved
Hide resolved
examples/netlify-functions/functions/removeFromCart/removeFromCart.js
Outdated
Show resolved
Hide resolved
examples/ecommerce-netlify-functions/functions/removeFromCart.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made a couple of quick changes, but still have a few more suggestions. But this is almost ready to go pending a couple of small fixes.
examples/ecommerce-netlify-functions/netlify/functions/addToCart.js
Outdated
Show resolved
Hide resolved
examples/ecommerce-netlify-functions/netlify/functions/checkout.js
Outdated
Show resolved
Hide resolved
@@ -2,5 +2,7 @@ | |||
|
|||
module.exports = Object.freeze({ | |||
mongodbUri: 'mongodb://localhost:27017/ecommerce', | |||
stripeSecretKey: 'YOUR STRIPE KEY HERE' | |||
stripeSecretKey: 'YOUR STRIPE KEY HERE', | |||
success_url: 'localhost:3000/success', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👎 camelCase, no snake_case
productName: String, | ||
productPrice: Number | ||
name: String, | ||
price: Number, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't update tests to reflect this change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gonna merge this and get it into mongoosejs/sample-apps for future work
Not done