-
-
Notifications
You must be signed in to change notification settings - Fork 320
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:itswadesh/svelte-commerce
- Loading branch information
Showing
9 changed files
with
180 additions
and
177 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
File renamed without changes.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
import { CollectionService, DealsService, HomeService } from '$lib/services' | ||
const isServer = import.meta.env.SSR | ||
|
||
export async function load({ parent }) { | ||
const { store, origin } = await parent() | ||
|
||
return { | ||
streamed: { | ||
home: HomeService.fetchHome({ origin, storeId: store?.id, server: isServer }), | ||
|
||
deals: DealsService.fetchDeals({ origin, storeId: store?.id, server: isServer }), | ||
|
||
collections: CollectionService.fetchCollections({ | ||
origin, | ||
storeId: store?.id, | ||
server: isServer | ||
}) | ||
}, | ||
|
||
origin | ||
} | ||
} | ||
import { CollectionService, DealsService, HomeService } from '$lib/services' | ||
const isServer = import.meta.env.SSR | ||
|
||
export async function load({ parent }) { | ||
const { store, origin } = await parent() | ||
|
||
return { | ||
streamed: { | ||
home: HomeService.fetchHome({ origin, storeId: store?.id, server: isServer }), | ||
|
||
deals: DealsService.fetchDeals({ origin, storeId: store?.id, server: isServer }), | ||
|
||
collections: CollectionService.fetchCollections({ | ||
origin, | ||
storeId: store?.id, | ||
server: isServer | ||
}) | ||
}, | ||
|
||
origin | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
export const prerender = false | ||
|
||
import { DOMAIN, HTTP_ENDPOINT } from '$lib/config' | ||
import { error } from '@sveltejs/kit' | ||
import type { LayoutServerLoad } from './$types' | ||
|
||
export const load: LayoutServerLoad = async ({ url, locals, cookies }) => { | ||
try { | ||
const currentPage = +url.searchParams.get('page') || 1 | ||
const q = url.searchParams.get('q') || '' | ||
const { pathname } = url | ||
|
||
// setHeaders({ | ||
// 'cache-control': 'public, max-age=300' | ||
// }) | ||
const zip = cookies.get('zip') | ||
locals.url = url.href | ||
locals.currentPage = currentPage | ||
locals.q = q | ||
locals.sid = cookies.get('connect.sid') | ||
locals.cartQty = cookies.get('cartQty') | ||
if (zip) locals.zip = JSON.parse(zip) | ||
// me, | ||
return { ...locals, pathname } | ||
} catch (e) { | ||
throw error( | ||
404, | ||
`Store Not Found @Layout | ||
<br/>ID: ${locals.store.id} | ||
<br/>ORIGIN: ${locals.origin} | ||
<br/>DOMAIN(env): ${DOMAIN} | ||
<br/>HTTP_ENDPOINT(env): ${HTTP_ENDPOINT}` | ||
) | ||
} | ||
} | ||
export const prerender = false | ||
|
||
import { DOMAIN, HTTP_ENDPOINT } from '$lib/config' | ||
import { error } from '@sveltejs/kit' | ||
import type { LayoutServerLoad } from './$types' | ||
|
||
export const load: LayoutServerLoad = async ({ url, locals, cookies }) => { | ||
try { | ||
const currentPage = +url.searchParams.get('page') || 1 | ||
const q = url.searchParams.get('q') || '' | ||
const { pathname } = url | ||
|
||
// setHeaders({ | ||
// 'cache-control': 'public, max-age=300' | ||
// }) | ||
const zip = cookies.get('zip') | ||
locals.url = url.href | ||
locals.currentPage = currentPage | ||
locals.q = q | ||
locals.sid = cookies.get('connect.sid') | ||
locals.cartQty = cookies.get('cartQty') | ||
if (zip) locals.zip = JSON.parse(zip) | ||
// me, | ||
return { ...locals, pathname } | ||
} catch (e) { | ||
throw error( | ||
404, | ||
`Store Not Found @Layout | ||
<br/>ID: ${locals.store.id} | ||
<br/>ORIGIN: ${locals.origin} | ||
<br/>DOMAIN(env): ${DOMAIN} | ||
<br/>HTTP_ENDPOINT(env): ${HTTP_ENDPOINT}` | ||
) | ||
} | ||
} |
c87339c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
svelte-commerce – ./
hopyshopy.com
oxaaa.com
arialmall.com
happyhappy.in
www.oxaaa.com
www.happyhappy.in
arialshop.com
svelte-commerce-rho.vercel.app
www.arialshop.com
www.arialmall.com
svelte-commerce-itswadesh.vercel.app
www.hopyshopy.com
svelte-commerce-git-master-itswadesh.vercel.app