21 |
22 | VPS vs Vercel - Ashley Rudland's VPS Playground
23 |
24 |
25 |
26 | Source code:{' '}
27 |
33 | GitHub
34 |
35 |
36 |
37 | Do we need Vercel? (
38 |
43 | it seems not
44 |
45 | ) Can we just run our NextJS apps on a VM? Maybe all our
46 | apps on one machine?
47 |
48 |
49 |
50 | I love NextJS, but I don't like Vercels pricing. It seems
51 | nuts to me and it seems many other people do too. So I spent
52 | a few hours playing with this and Hetzner Cloud (€3.30/mo
53 | 🤣) to see what was possible.
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 | >
62 | );
63 | }
64 |
--------------------------------------------------------------------------------
/src/app/up/route.ts:
--------------------------------------------------------------------------------
1 | console.log(`${new Date().toISOString()}: /up route.ts loaded`);
2 |
3 | export async function GET() {
4 | console.log(`${new Date().toISOString()}: /up GET hit`);
5 | return new Response('Ok', { status: 200 });
6 | }
7 |
--------------------------------------------------------------------------------
/src/components/tests/capacity.tsx:
--------------------------------------------------------------------------------
1 | 'use client';
2 |
3 | import { useState, useEffect } from 'react';
4 |
5 | import Chart from './chart';
6 | import { TestCard } from '@/components/ui/test-card';
7 | import { Spinner } from '@/components/ui/spinner';
8 |
9 | function secondsToTime(seconds: number) {
10 | const hours = Math.floor(seconds / 3600);
11 | const minutes = Math.floor((seconds % 3600) / 60);
12 | const remainingSeconds = Math.round(seconds % 60);
13 | return `${hours}hr ${minutes}m ${remainingSeconds}s`;
14 | }
15 |
16 | const Capacity = () => {
17 | const [loading, setLoading] = useState(true);
18 | const [error, setError] = useState