summaryrefslogtreecommitdiff
path: root/examples/ssr/src
diff options
context:
space:
mode:
authorGravatar matthewp <matthewp@users.noreply.github.com> 2022-02-14 17:50:16 +0000
committerGravatar GitHub Actions <actions@github.com> 2022-02-14 17:50:16 +0000
commitf84848226d9aa0876a854e5195184925cc793781 (patch)
tree02238d3ee53d8c7640b1df8d5eb692e341a5a77c /examples/ssr/src
parentba5e2b5e6c20207955991775dc4aa8879331542c (diff)
downloadastro-f84848226d9aa0876a854e5195184925cc793781.tar.gz
astro-f84848226d9aa0876a854e5195184925cc793781.tar.zst
astro-f84848226d9aa0876a854e5195184925cc793781.zip
[ci] yarn format
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;
}