refactor: use global setting for Vercel Edge runtime
This commit is contained in:
@@ -3,9 +3,6 @@ import type { LayoutServerLoad } from './$types'
|
|||||||
import { fetchAPI } from '$utils/api'
|
import { fetchAPI } from '$utils/api'
|
||||||
import { fetchSwell } from '$utils/functions/shopServer'
|
import { fetchSwell } from '$utils/functions/shopServer'
|
||||||
|
|
||||||
export const config = {
|
|
||||||
runtime: 'edge'
|
|
||||||
}
|
|
||||||
|
|
||||||
export const load = (async () => {
|
export const load = (async () => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -4,9 +4,6 @@ import { fetchAPI } from '$utils/api'
|
|||||||
import { getRandomItem } from 'utils/array'
|
import { getRandomItem } from 'utils/array'
|
||||||
import { fetchSwell } from '$utils/functions/shopServer'
|
import { fetchSwell } from '$utils/functions/shopServer'
|
||||||
|
|
||||||
export const config = {
|
|
||||||
runtime: 'edge'
|
|
||||||
}
|
|
||||||
|
|
||||||
export const load = (async ({ setHeaders }) => {
|
export const load = (async ({ setHeaders }) => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -3,9 +3,6 @@ import type { PageServerLoad } from './$types'
|
|||||||
import { fetchAPI } from '$utils/api'
|
import { fetchAPI } from '$utils/api'
|
||||||
import { fetchSwell } from '$utils/functions/shopServer'
|
import { fetchSwell } from '$utils/functions/shopServer'
|
||||||
|
|
||||||
export const config = {
|
|
||||||
runtime: 'edge'
|
|
||||||
}
|
|
||||||
|
|
||||||
export const load = (async ({ params, setHeaders }) => {
|
export const load = (async ({ params, setHeaders }) => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -3,9 +3,6 @@ import type { PageServerLoad } from './$types'
|
|||||||
import { PUBLIC_LIST_AMOUNT } from '$env/static/public'
|
import { PUBLIC_LIST_AMOUNT } from '$env/static/public'
|
||||||
import { fetchAPI, photoFields } from '$utils/api'
|
import { fetchAPI, photoFields } from '$utils/api'
|
||||||
|
|
||||||
export const config = {
|
|
||||||
runtime: 'edge'
|
|
||||||
}
|
|
||||||
|
|
||||||
export const load = (async ({ params, setHeaders }) => {
|
export const load = (async ({ params, setHeaders }) => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -2,9 +2,6 @@ import { error } from '@sveltejs/kit'
|
|||||||
import type { PageServerLoad } from './$types'
|
import type { PageServerLoad } from './$types'
|
||||||
import { fetchAPI } from '$utils/api'
|
import { fetchAPI } from '$utils/api'
|
||||||
|
|
||||||
export const config = {
|
|
||||||
runtime: 'edge'
|
|
||||||
}
|
|
||||||
|
|
||||||
export const load = (async ({ params, setHeaders }) => {
|
export const load = (async ({ params, setHeaders }) => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -3,9 +3,6 @@ import type { PageServerLoad } from './$types'
|
|||||||
import { fetchAPI } from '$utils/api'
|
import { fetchAPI } from '$utils/api'
|
||||||
import { getRandomItems } from 'utils/array'
|
import { getRandomItems } from 'utils/array'
|
||||||
|
|
||||||
export const config = {
|
|
||||||
runtime: 'edge'
|
|
||||||
}
|
|
||||||
|
|
||||||
export const load = (async ({ setHeaders }) => {
|
export const load = (async ({ setHeaders }) => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -2,9 +2,6 @@ import { error } from '@sveltejs/kit'
|
|||||||
import type { RequestHandler } from './$types'
|
import type { RequestHandler } from './$types'
|
||||||
import { fetchAPI } from '$utils/api'
|
import { fetchAPI } from '$utils/api'
|
||||||
|
|
||||||
export const config = {
|
|
||||||
runtime: 'edge'
|
|
||||||
}
|
|
||||||
|
|
||||||
export const POST = (async ({ request, setHeaders }) => {
|
export const POST = (async ({ request, setHeaders }) => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -2,9 +2,6 @@ import { error } from '@sveltejs/kit'
|
|||||||
import type { PageServerLoad } from './$types'
|
import type { PageServerLoad } from './$types'
|
||||||
import { fetchAPI } from '$utils/api'
|
import { fetchAPI } from '$utils/api'
|
||||||
|
|
||||||
export const config = {
|
|
||||||
runtime: 'edge'
|
|
||||||
}
|
|
||||||
|
|
||||||
export const load = (async ({ setHeaders }) => {
|
export const load = (async ({ setHeaders }) => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -3,9 +3,6 @@ import type { RequestHandler } from './$types'
|
|||||||
import { fetchSwell } from '$utils/functions/shopServer'
|
import { fetchSwell } from '$utils/functions/shopServer'
|
||||||
import { fetchAPI, getAssetUrlKey } from '$utils/api'
|
import { fetchAPI, getAssetUrlKey } from '$utils/api'
|
||||||
|
|
||||||
export const config = {
|
|
||||||
runtime: 'edge'
|
|
||||||
}
|
|
||||||
|
|
||||||
const gCategories = [
|
const gCategories = [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,9 +3,6 @@ import type { PageServerLoad } from './$types'
|
|||||||
import { fetchAPI } from '$utils/api'
|
import { fetchAPI } from '$utils/api'
|
||||||
import { PUBLIC_FILTERS_DEFAULT_COUNTRY, PUBLIC_FILTERS_DEFAULT_SORT, PUBLIC_GRID_AMOUNT } from '$env/static/public'
|
import { PUBLIC_FILTERS_DEFAULT_COUNTRY, PUBLIC_FILTERS_DEFAULT_SORT, PUBLIC_GRID_AMOUNT } from '$env/static/public'
|
||||||
|
|
||||||
export const config = {
|
|
||||||
runtime: 'edge'
|
|
||||||
}
|
|
||||||
|
|
||||||
export const load = (async ({ url, setHeaders }) => {
|
export const load = (async ({ url, setHeaders }) => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -2,9 +2,6 @@ import { error } from '@sveltejs/kit'
|
|||||||
import type { PageServerLoad } from './$types'
|
import type { PageServerLoad } from './$types'
|
||||||
import { fetchAPI } from '$utils/api'
|
import { fetchAPI } from '$utils/api'
|
||||||
|
|
||||||
export const config = {
|
|
||||||
runtime: 'edge'
|
|
||||||
}
|
|
||||||
|
|
||||||
export const load = (async ({ setHeaders }) => {
|
export const load = (async ({ setHeaders }) => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -2,9 +2,6 @@ import { error } from '@sveltejs/kit'
|
|||||||
import type { PageServerLoad } from './$types'
|
import type { PageServerLoad } from './$types'
|
||||||
import { fetchAPI } from '$utils/api'
|
import { fetchAPI } from '$utils/api'
|
||||||
|
|
||||||
export const config = {
|
|
||||||
runtime: 'edge'
|
|
||||||
}
|
|
||||||
|
|
||||||
export const load = (async ({ setHeaders }) => {
|
export const load = (async ({ setHeaders }) => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -3,9 +3,6 @@ import type { LayoutServerLoad } from './$types'
|
|||||||
import { fetchAPI } from '$utils/api'
|
import { fetchAPI } from '$utils/api'
|
||||||
import { PUBLIC_PREVIEW_COUNT } from '$env/static/public'
|
import { PUBLIC_PREVIEW_COUNT } from '$env/static/public'
|
||||||
|
|
||||||
export const config = {
|
|
||||||
runtime: 'edge'
|
|
||||||
}
|
|
||||||
|
|
||||||
export const load = (async () => {
|
export const load = (async () => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -3,9 +3,6 @@ import type { PageServerLoad } from './$types'
|
|||||||
import { fetchAPI } from '$utils/api'
|
import { fetchAPI } from '$utils/api'
|
||||||
import { getRandomItems } from 'utils/array'
|
import { getRandomItems } from 'utils/array'
|
||||||
|
|
||||||
export const config = {
|
|
||||||
runtime: 'edge'
|
|
||||||
}
|
|
||||||
|
|
||||||
export const load = (async ({ setHeaders }) => {
|
export const load = (async ({ setHeaders }) => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
import { NEWSLETTER_API_TOKEN, NEWSLETTER_LIST_ID } from '$env/static/private'
|
import { NEWSLETTER_API_TOKEN, NEWSLETTER_LIST_ID } from '$env/static/private'
|
||||||
import type { RequestHandler } from './$types'
|
import type { RequestHandler } from './$types'
|
||||||
|
|
||||||
export const config = {
|
|
||||||
runtime: 'edge'
|
|
||||||
}
|
|
||||||
|
|
||||||
export const POST = (async ({ request, fetch }) => {
|
export const POST = (async ({ request, fetch }) => {
|
||||||
const data: { email: string } = await request.json()
|
const data: { email: string } = await request.json()
|
||||||
|
|||||||
@@ -2,9 +2,6 @@ import { error } from '@sveltejs/kit'
|
|||||||
import type { RequestHandler } from './$types'
|
import type { RequestHandler } from './$types'
|
||||||
import { fetchAPI } from '$utils/api'
|
import { fetchAPI } from '$utils/api'
|
||||||
|
|
||||||
export const config = {
|
|
||||||
runtime: 'edge'
|
|
||||||
}
|
|
||||||
|
|
||||||
export const GET = (async ({ url, setHeaders }) => {
|
export const GET = (async ({ url, setHeaders }) => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import preprocess from 'svelte-preprocess'
|
import preprocess from 'svelte-preprocess'
|
||||||
import adapter from '@sveltejs/adapter-auto'
|
import adapter from '@sveltejs/adapter-vercel'
|
||||||
import { fileURLToPath } from 'url'
|
import { fileURLToPath } from 'url'
|
||||||
import { dirname } from 'path'
|
import { dirname } from 'path'
|
||||||
|
|
||||||
@@ -17,7 +17,9 @@ const config = {
|
|||||||
}),
|
}),
|
||||||
|
|
||||||
kit: {
|
kit: {
|
||||||
adapter: adapter(),
|
adapter: adapter({
|
||||||
|
runtime: 'edge',
|
||||||
|
}),
|
||||||
alias: {
|
alias: {
|
||||||
$components: 'src/components',
|
$components: 'src/components',
|
||||||
$animations: 'src/animations',
|
$animations: 'src/animations',
|
||||||
|
|||||||
Reference in New Issue
Block a user