Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

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
plugins: [
/**
* Content Plugins
*/
{
resolve: `gatsby-plugin-s3`,
options: {
bucketName: 'my-website-bucket',
},
},
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": [
"s3:GetObject"
],
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",
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);
<% 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>
<ul>
<% uploads.forEach(upload => { %>
<li>
<a download href="<%= upload.url %>"><%= upload.file_name %></a>
</li>
<% }); %>
</ul>
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",
...
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",
<% 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>