diff --git a/.eslintignore b/.eslintignore index 7af4e43..93619ad 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,2 +1,5 @@ +# Gatsby public/ +.cache + .vercel diff --git a/.eslintrc.json b/.eslintrc.json index d0fc778..d25f5f4 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -19,7 +19,13 @@ "react" ], "rules": { - "semi": [ "error", "never" ], - "quotes": [ "error", "double" ] + "semi": [ + "error", + "never" + ], + "quotes": [ + "error", + "double" + ] } } diff --git a/api/index.js b/api/index.js index abeed9e..6892a9c 100644 --- a/api/index.js +++ b/api/index.js @@ -1,6 +1,7 @@ -import connectToDatabase from "./lib/dbConnect" import fetch from "node-fetch" +import connectToDatabase from "./lib/dbConnect" + export default async (req, res) => { const { method } = req const db = await connectToDatabase() diff --git a/api/lib/dbConnect.js b/api/lib/dbConnect.js index e9a9b8e..104d51d 100644 --- a/api/lib/dbConnect.js +++ b/api/lib/dbConnect.js @@ -2,18 +2,6 @@ import { MongoClient } from "mongodb" const { MONGODB_URI, MONGODB_DB, MONGODB_COLLECTION } = process.env -if (!MONGODB_URI) { - throw new Error( - "Please define the MONGODB_URI environment variable inside .env.local" - ) -} - -if (!MONGODB_DB) { - throw new Error( - "Please define the MONGODB_DB environment variable inside .env.local" - ) -} - let cached = global.mongo if (!cached) { @@ -39,5 +27,6 @@ export default async function connectToDatabase() { }) } cached.conn = await cached.promise + return cached.conn } diff --git a/gatsby-config.js b/gatsby-config.js index d3d7fe6..21040fd 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -6,6 +6,8 @@ module.exports = { }, plugins: [ "gatsby-plugin-react-helmet", + "gatsby-plugin-transition-link", + "gatsby-plugin-sass", { resolve: "gatsby-plugin-manifest", options: { @@ -17,8 +19,6 @@ module.exports = { display: "minimal-ui", icon: "src/images/icon.png", // This path is relative to the root of the site. } - }, - "gatsby-plugin-transition-link", - "gatsby-plugin-sass" + } ] } diff --git a/renovate.json b/renovate.json index 8195dda..d6a00ab 100644 --- a/renovate.json +++ b/renovate.json @@ -6,7 +6,12 @@ "prCreation": "immediate", "packageRules": [ { - "matchUpdateTypes": ["minor", "patch", "pin", "digest"], + "matchUpdateTypes": [ + "minor", + "patch", + "pin", + "digest" + ], "automerge": true } ]