forked from fac18/safe-space
-
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.
make netlify function to establish airtable base connection
- Loading branch information
groupanimal
committed
Feb 10, 2020
1 parent
47de985
commit 5e831e7
Showing
10 changed files
with
110 additions
and
32 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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
[build] | ||
publish = "build" | ||
functions = "functions" |
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 |
---|---|---|
|
@@ -3,4 +3,5 @@ module.exports = { | |
tabWidth: 2, | ||
semi: true, | ||
singleQuote: true, | ||
jsxSingleQuote: true, | ||
}; |
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,2 +1,4 @@ | ||
language: node_js | ||
cache: node_modules | ||
node_js: | ||
- 12 |
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,11 +1,15 @@ | ||
# safe-space | ||
# Safe Space | ||
|
||
A project for the MU | ||
A project for the MU. | ||
|
||
## Installation | ||
## Installation and architecture | ||
|
||
Clone this repo, navigate into the directory and run `npm i`, | ||
|
||
In order to run the app, you'll need to have the Netlify CLI installed. You can do this globally on your machine by running `npm i -g netlify-cli`. | ||
|
||
We then run `netlify dev` to start both the React server (on port 3000), the Functions server (on a random port), and the combined result on port 8888. | ||
|
||
We are using the [Airtable.js](https://github.com/Airtable/airtable.js) npm package within Netlify Functions (i.e. AWS Lambdas) to conduct CRUD operations on our Airtable base without revealing any secrets. | ||
|
||
[This article](https://medium.com/swlh/up-and-running-with-netlify-airtable-and-react-428959473cf0) explains set up, while [this is a useful resource](https://flaviocopes.com/airtable/) for understanding how to interact with the base using this package. |
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
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,6 +1,6 @@ | ||
import React from "react"; | ||
import ReactDOM from "react-dom"; | ||
import "./index.css"; | ||
import App from "./components/App/App"; | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import './index.css'; | ||
import App from './components/App/App'; | ||
|
||
ReactDOM.render(<App />, document.getElementById("root")); | ||
ReactDOM.render(<App />, document.getElementById('root')); |
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,7 @@ | ||
const getQuestions = async () => { | ||
await ( | ||
await fetch('./netlify/functions/get-questions/get-questions.js') | ||
).json(); | ||
}; | ||
|
||
export default getQuestions; |