Guest User

Untitled

a guest
Jul 8th, 2024
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. import React from 'react';
  2. import Image from 'next/image';
  3.  
  4. export default async function IndexFull() {
  5. let serverCount: String | null = null;
  6. async function refreshResponse() {
  7. try {
  8. const response = await fetch('http://localhost:3000/api/clientsize', { cache: 'no-store' });
  9. if (!response.ok) {
  10. throw new Error('Failed to fetch server count');
  11. }
  12. const data = await response.json();
  13. serverCount = data.count;
  14.  
  15. } catch (error) {
  16. console.error('Error fetching server count:', error);
  17. }
  18. }
  19. await refreshResponse();
  20. return (
  21. <>
  22. //Page context here
  23. </>
  24. );
  25. }
Advertisement
Add Comment
Please, Sign In to add comment