import supabase from '../api/supabase';
export const getServerSideProps = async () => {
const { data: customers, error } = await supabase.from('customer').select('*');
if (error) throw new Error(error.message);
return {
props: {
customers
}
}
}
const ServerRenderedComp = ({ customers }: { customers: any }) => {
return (
<>
<p>Vendors!</p>
<pre>{JSON.stringify(customers, null, 2)}</pre>
</>
)
}
export default ServerRenderedComp
import supabase from '../api/supabase';
export const getServerSideProps = async () => {
const { data: customers, error } = await supabase.from('customer').select('*');
if (error) throw new Error(error.message);
return {
props: {
customers
}
}
}
const ServerRenderedComp = ({ customers }: { customers: any }) => {
return (
<>
<p>Vendors!</p>
<pre>{JSON.stringify(customers, null, 2)}</pre>
</>
)
}
export default ServerRenderedComp