Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ RUN apk add --no-cache \
# download and unzip PocketBase
ADD https://github.com/pocketbase/pocketbase/releases/download/v${PB_VERSION}/pocketbase_${PB_VERSION}_linux_amd64.zip /tmp/pb.zip
RUN unzip /tmp/pb.zip -d /pb/
COPY pb_hooks /pb/pb_hooks
COPY pb_public /pb/pb_public

EXPOSE 8080

Expand Down
5 changes: 5 additions & 0 deletions pb_hooks/main.pb.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
routerAdd("GET", "/hello", (e) => {
let name = e.request.url.query().get("name") || "Person";

return e.json(200, { message: "Hello " + name });
});
64 changes: 64 additions & 0 deletions pb_public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hello World - PocketBase</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: #333;
}

.container {
background: white;
padding: 3rem;
border-radius: 12px;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
text-align: center;
max-width: 600px;
}

h1 {
font-size: 3rem;
margin-bottom: 1rem;
color: #667eea;
}

p {
font-size: 1.2rem;
color: #666;
margin-top: 1rem;
}

.status {
display: inline-block;
margin-top: 2rem;
padding: 0.5rem 1.5rem;
background: #10b981;
color: white;
border-radius: 6px;
font-weight: 600;
}
</style>
</head>
<body>
<div class="container">
<h1>Hello World!</h1>
<p>PocketBase is successfully serving this page.</p>
<div class="status">✓ Server is running</div>
</div>
</body>
</html>