summaryrefslogtreecommitdiff
path: root/examples/ssr/src
diff options
context:
space:
mode:
Diffstat (limited to 'examples/ssr/src')
-rw-r--r--examples/ssr/src/api.ts10
-rw-r--r--examples/ssr/src/styles/common.css2
2 files changed, 5 insertions, 7 deletions
diff --git a/examples/ssr/src/api.ts b/examples/ssr/src/api.ts
index 9fd7d0683..0ae8648c8 100644
--- a/examples/ssr/src/api.ts
+++ b/examples/ssr/src/api.ts
@@ -7,13 +7,11 @@ interface Product {
//let origin: string;
const { mode } = import.meta.env;
-const origin = mode === 'develeopment' ?
- `http://localhost:3000` :
- `http://localhost:8085`;
+const origin = mode === 'develeopment' ? `http://localhost:3000` : `http://localhost:8085`;
async function get<T>(endpoint: string, cb: (response: Response) => Promise<T>): Promise<T> {
const response = await fetch(`${origin}${endpoint}`);
- if(!response.ok) {
+ if (!response.ok) {
// TODO make this better...
return null;
}
@@ -21,14 +19,14 @@ async function get<T>(endpoint: string, cb: (response: Response) => Promise<T>):
}
export async function getProducts(): Promise<Product[]> {
- return get<Product[]>('/api/products', async response => {
+ return get<Product[]>('/api/products', async (response) => {
const products: Product[] = await response.json();
return products;
});
}
export async function getProduct(id: number): Promise<Product> {
- return get<Product>(`/api/products/${id}`, async response => {
+ return get<Product>(`/api/products/${id}`, async (response) => {
const product: Product = await response.json();
return product;
});
diff --git a/examples/ssr/src/styles/common.css b/examples/ssr/src/styles/common.css
index 7879df33c..9d73ad1a4 100644
--- a/examples/ssr/src/styles/common.css
+++ b/examples/ssr/src/styles/common.css
@@ -1,3 +1,3 @@
body {
- font-family: "GT America Standard", "Helvetica Neue", Helvetica,Arial,sans-serif;
+ font-family: 'GT America Standard', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}