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
module.exports = { | |
siteUrl: `https://gatsby.matthew-a-brown.com`, // Site domain. Do not include a trailing slash! | |
postsPerPage: 12, // Number of posts shown on paginated pages (changes this requires sometimes to delete the cache) | |
siteTitleMeta: `Ghost Gatsby Starter`, // This allows an alternative site title for meta data for pages. | |
siteDescriptionMeta: `A starter template to build amazing static websites with Ghost and Gatsby`, // This allows an alternative site description for meta data for pages. | |
shareImageWidth: 1000, // Change to the width of your default share image | |
shareImageHeight: 523, // Change to the height of your default share image |
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
plugins: [ | |
/** | |
* Content Plugins | |
*/ | |
{ | |
resolve: `gatsby-plugin-s3`, | |
options: { | |
bucketName: 'my-website-bucket', | |
}, | |
}, |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "PublicReadGetObject", | |
"Effect": "Allow", | |
"Principal": "*", | |
"Action": [ | |
"s3:GetObject" | |
], |
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
const express = require("express"); | |
const passport = require("passport"); | |
const Strategy = require("passport-local").Strategy; | |
const models = require("./models"); | |
const formidable = require("formidable"); | |
const { v4: uuidv4 } = require("uuid"); | |
const fs = require("fs"); | |
const AWS = require("aws-sdk"); | |
const S3 = new AWS.S3({ | |
signatureVersion: "v4", |
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
function getSignedUrl(key) { | |
return new Promise((resolve, reject) => { | |
S3.getSignedUrl( | |
"getObject", | |
{ | |
Bucket: "image-upload-example-app", | |
Key: key, | |
}, | |
function (err, url) { | |
if (err) reject(err); |
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
<% if (!user) { %> | |
<p> | |
Welcome! Please <a href="/login">log in</a> or | |
<a href="/register">register</a>. | |
</p> | |
<% } else { %> | |
<div> | |
<p><a href="/files">View Files</a></p> | |
<p><a href="/upload">Upload</a></p> | |
<p><a href="/logout">Log out</a></p> |
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
<ul> | |
<% uploads.forEach(upload => { %> | |
<li> | |
<a download href="<%= upload.url %>"><%= upload.file_name %></a> | |
</li> | |
<% }); %> | |
</ul> |
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
const express = require("express"); | |
const passport = require("passport"); | |
const Strategy = require("passport-local").Strategy; | |
const models = require("./models"); | |
const formidable = require("formidable"); | |
const { v4: uuidv4 } = require("uuid"); | |
const fs = require("fs"); | |
const AWS = require("aws-sdk"); | |
const S3 = new AWS.S3({ | |
signatureVersion: "v4", |
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
... | |
const formidable = require("formidable"); | |
const { v4: uuidv4 } = require("uuid"); | |
const fs = require("fs"); | |
const AWS = require("aws-sdk"); | |
const S3 = new AWS.S3({ | |
signatureVersion: "v4", | |
apiVersion: "2006-03-01", | |
accessKeyId: "YOUR_ACCESS_KEY_HERE", | |
secretAccessKey: "SECRET_ACCESS_KEY_HERE", |
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
<% if (!user) { %> | |
<p> | |
Welcome! Please <a href="/login">log in</a> or | |
<a href="/register">register</a>. | |
</p> | |
<% } else { %> | |
<div> | |
<p><a href="/upload">Upload</a></p> | |
<p><a href="/logout">Log out</a></p> | |
</div> |
NewerOlder