Comments (3)
yup, thats about it!
i'll be honest that i havent precisely done this myself because i havent needed to but this is exactly how it would work in theory. if you try it and run into any problems (including security concerns), please report here and i'll do my best to help you research/resolve.
we have more on this i can't talk about coming soon - stay tuned
from netlify-faunadb-example.
thanks for your concern!
env vars can have contexts - https://www.netlify.com/docs/continuous-deployment/#deploy-contexts
so just be sure that your prod stuff is in a prod context and your deploy preview stuff is in a different one.
pretty neat huh!
from netlify-faunadb-example.
Thanks, @sw-yx – we figured Netlify had set up some way to avoid this problem, just weren't sure what it was.
It sounds like a good practice for a public project that talks to an API would be to do the following:
- Create a dummy account for whatever service is being used (Airtable in this case)
- Put the access key for that account into
netlify.toml
in[context.deploy-preview.environment]
. This will be exposed in the repo for all to see, but it's only dummy data - Keep the production access key in the Netlify admin; users who deploy their own copy of the app to their own Netlify instance will have to provide their own production data (their own Airtable account or whatever).
Is there anything I'm overlooking here? Thanks again!
from netlify-faunadb-example.
Related Issues (17)
- Solution for missing 'https' module / 500 response error
- Puzzling out UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'statusCode' of undefined HOT 3
- Stuck waiting for localhost:34567... HOT 1
- Works without setting faunadb key? HOT 2
- Follow AWS Lambda best practices HOT 2
- [Update] FaunaDB Add-on for Netlify
- functions build fail, need update the package.json HOT 2
- Add in due dates to todos and wire up Functions to notify users via email/SMS
- ◈ Empty args assigned, this is an internal Netlify Dev bug, please report your settings and scripts so we can improve HOT 7
- Error: Cannot find module 'faunadb' HOT 15
- Error After Following README Instructions HOT 1
- Deployed App url???
- Confused re tutorial HOT 5
- I needed to set FAUNADB_SERVER_SECRET as well as FAUNADB_SECRET for the app to work HOT 2
- Issue with formidable package inside of faunadb npm module HOT 3
- UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'statusCode' of undefined HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from netlify-faunadb-example.