This file contains hidden or 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
Aurora V1 (EOL’ing) | Aurora V2 | Planetscale | Neon | ||
---|---|---|---|---|---|
“No SSH” | ✅ | ✅ | ✅ | ✅ | |
Autoscaling | ✅ | ✅ | ❌Up on certain tiers, down within limits | ✅ | |
Pay based on usage | ✅Compute, Storage, Network | ✅Compute, Storage, Network | ✅Compute, Storage, Reads, Writes | ✅Compute, Storage | |
Resource usage scales to zero | ✅*with slow cold starts | ❌ | ❌ | ✅ | |
Cost scales to zero | ✅ | ❌ | ❌ | ❌$19/month minimum |
This file contains hidden or 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
import { NextRequest, NextResponse } from "next/server"; | |
import { Redis } from "@upstash/redis"; | |
export const config = { | |
runtime: "edge", | |
}; | |
if ( | |
!process.env.UPSTASH_REDIS_REST_URL || | |
!process.env.UPSTASH_REDIS_REST_TOKEN | |
) { |
This file contains hidden or 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
- from: /me | |
to: https://github.com/ThewBear | |
status: 308 # Change status code ex. 301, 302, 307 (Default), 308 | |
- from: /google/:q # Match exactly one ex. /google/recursion | |
to: https://google.com/search?q=:q | |
- from: /vercel/:slug* # Match zero or more ex. /vercel /vercel/docs /vercel/solutions/nextjs | |
to: https://vercel.com/:slug | |
- from: /twitter/:slug? # Match Zero or one ex. /twitter /twitter/thewdhanat | |
to: https://twitter.com/:slug | |
- from: /github/:slug+ # One or more ex. /github/ThewApp github/ThewApp/vercel-shorturl |
This file contains hidden or 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
// /api/reverse-proxy/[...all].ts | |
import { NextApiRequest, NextApiResponse } from "next/types"; | |
import httpProxyMiddleware from "next-http-proxy-middleware"; | |
export const config = { | |
api: { | |
externalResolver: true, | |
}, |
This file contains hidden or 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
// STEPS to solve a problem: | |
// 1. define what are the input variables | |
// 2. what is the output format or the result | |
// 3. define what constants are in the problem? | |
// 3. (not always) Find the solution the real world if you had to give these instruction to a group of kids | |
// 4. Reverse engineer the ouput from input | |
// INPUT variables for the room size | |
// l = number, lenght of the room in m | |
// h = number, height of the room in m |
This file contains hidden or 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
/// <reference types="cypress-mailosaur" /> | |
describe("Slack New Account Email", async function () { | |
Cypress.on("uncaught:exception", () => { | |
return false; | |
}); | |
const testId = new Date().getTime(); | |
const serverId = "SERVER_ID"; // Replace this ID with your actual Mailosaur Server ID | |
const testEmail = `slack-new-account${testId}@${serverId}.mailosaur.net`; |
This file contains hidden or 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
describe("Stripe Checkout", () => { | |
it("Stripe Checkout test mode works!", () => { | |
cy.request( | |
"https://checkout.stripe.dev/api/demo-session?country=us&billingPeriod=monthly&hasBgColor=false&hasBillingAndShipping=false&hasCoupons=false&hasFreeTrial=false&hasShippingRate=false&hasTaxes=false&mode=payment&wallet=googlePay&hasPolicies=false&billingType=flat" | |
).then((response) => { | |
expect(response.status).to.eq(200); | |
expect(response.body).to.have.property("url"); | |
cy.visit(response.body.url); | |
cy.url().should("contains", "https://checkout.stripe.com/pay/"); |
This file contains hidden or 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 baseUrlTesla = "https://www.tesla.com/"; | |
const url404test = "https://www.tesla.com/not-a-real-page"; | |
it("404 'not found' response", () => { | |
cy.request({ | |
url: url404test, | |
followRedirect: false, | |
failOnStatusCode: false, | |
}).then((resp) => { | |
expect(resp.status).to.eq(404); | |
expect(resp.redirectedToUrl).to.eq(undefined); |
NewerOlder