Commit 0c877eab authored by Carolina Gilabert's avatar Carolina Gilabert

Listing object keys on UI.

parent 3a0b4330
...@@ -1510,53 +1510,6 @@ ...@@ -1510,53 +1510,6 @@
} }
} }
}, },
"aws-sdk": {
"version": "2.400.0",
"resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.400.0.tgz",
"integrity": "sha512-FJjRXajLnI52F0C1E4nFARk/907x4ZuffwFd6jiBQfaepT03wsY1PcJNEQ5CNHYA2qxAx4HezL2pKySEX+g87g==",
"requires": {
"buffer": "4.9.1",
"events": "1.1.1",
"ieee754": "1.1.8",
"jmespath": "0.15.0",
"querystring": "0.2.0",
"sax": "1.2.1",
"url": "0.10.3",
"uuid": "3.3.2",
"xml2js": "0.4.19"
},
"dependencies": {
"events": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz",
"integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ="
},
"ieee754": {
"version": "1.1.8",
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.8.tgz",
"integrity": "sha1-vjPUCsEO8ZJnAfbwii2G+/0a0+Q="
},
"punycode": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz",
"integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0="
},
"sax": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.1.tgz",
"integrity": "sha1-e45lYZCyKOgaZq6nSEgNgozS03o="
},
"url": {
"version": "0.10.3",
"resolved": "https://registry.npmjs.org/url/-/url-0.10.3.tgz",
"integrity": "sha1-Ah5NnHcF8hu/N9A861h2dAJ3TGQ=",
"requires": {
"punycode": "1.3.2",
"querystring": "0.2.0"
}
}
}
},
"aws-sign2": { "aws-sign2": {
"version": "0.7.0", "version": "0.7.0",
"resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz",
...@@ -1567,6 +1520,15 @@ ...@@ -1567,6 +1520,15 @@
"resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz",
"integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ=="
}, },
"axios": {
"version": "0.18.0",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.18.0.tgz",
"integrity": "sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=",
"requires": {
"follow-redirects": "^1.3.0",
"is-buffer": "^1.1.5"
}
},
"axobject-query": { "axobject-query": {
"version": "2.0.2", "version": "2.0.2",
"resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-2.0.2.tgz", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-2.0.2.tgz",
...@@ -9023,11 +8985,6 @@ ...@@ -9023,11 +8985,6 @@
} }
} }
}, },
"jmespath": {
"version": "0.15.0",
"resolved": "https://registry.npmjs.org/jmespath/-/jmespath-0.15.0.tgz",
"integrity": "sha1-o/Iiqarp+Wb10nx5ZRDigJF2Qhc="
},
"joi": { "joi": {
"version": "12.0.0", "version": "12.0.0",
"resolved": "https://registry.npmjs.org/joi/-/joi-12.0.0.tgz", "resolved": "https://registry.npmjs.org/joi/-/joi-12.0.0.tgz",
......
{ {
"dependencies": { "dependencies": {
"axios": "^0.18.0",
"gatsby": "^2.0.118", "gatsby": "^2.0.118",
"gatsby-image": "^2.0.29", "gatsby-image": "^2.0.29",
"gatsby-plugin-manifest": "^2.0.17", "gatsby-plugin-manifest": "^2.0.17",
......
...@@ -31,7 +31,7 @@ const Layout = ({ children }) => ( ...@@ -31,7 +31,7 @@ const Layout = ({ children }) => (
<footer> <footer>
© {new Date().getFullYear()}, Built with 💛 by © {new Date().getFullYear()}, Built with 💛 by
{` `} {` `}
<a href="https://twitter.com/CarolSaysThings" target="_blank">Carolina Gilabert</a> <a href="https://twitter.com/CarolSaysThings" target="_blank" rel="noopener noreferrer">Carolina Gilabert</a>
</footer> </footer>
</div> </div>
</> </>
......
import React from "react" import React from "react"
import axios from "axios"
import Layout from "../components/layout" import Layout from "../components/layout"
import SEO from "../components/seo" import SEO from "../components/seo"
const IndexPage = () => ( class IndexPage extends React.Component {
<Layout> state = { keys: [] }
<SEO title="Home" keywords={[`gatsby`, `application`, `react`]} />
<h1>Hi people</h1> componentDidMount() {
<p>I'm trying to get a static site in an S3 talking to an ALB that targets a lambda, to access the contents of another S3 bucket.</p> this.fetchObjectKeys()
<p>Let's see what happens.</p> }
</Layout>
) fetchObjectKeys() {
const urlALB = 'http://object-finder-97329035.eu-west-1.elb.amazonaws.com';
axios.get(urlALB)
.then(response => {
this.setState({
keys: response.data.Contents
})
})
.catch(error => console.error(error));
}
render() {
return (
<Layout>
<SEO title="Home" keywords={[`gatsby`, `application`, `react`]} />
<h1>Hi people</h1>
<p>I'm trying to get a static site in an S3 talking to an ALB that targets a lambda, to access the contents of another S3 bucket.</p>
<p>Let's see what happens.</p>
<div>
<h2>Object Keys</h2>
<ul>{this.state.keys.map(el => <li key={el.Key}> {el.Key} </li>)}</ul>
</div>
</Layout>
);
}
}
export default IndexPage export default IndexPage
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment