Skip to content
1 change: 0 additions & 1 deletion .env

This file was deleted.

21 changes: 15 additions & 6 deletions main.w
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
bring cloud;
bring util;
bring http;
bring expect;

let secret = new cloud.Secret(
name: "MY_SECRET",
let website = new cloud.Website(
path: "./website",
);

new cloud.Function(inflight () => {
return secret.value();
});

test "renders the index page" {
log("website.url: {website.url}");

let response = http.get(website.url);
log("response: {Json.stringify(response)} ");

expect.equal(response.status, 200);
assert(response.body?.contains("Hello, Wing") == true);

}
9 changes: 0 additions & 9 deletions on_deploy.main.w

This file was deleted.

24 changes: 24 additions & 0 deletions website/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Hello Wing</title>

<!-- Tailwind CSS Play CDN https://tailwindcss.com/docs/installation/play-cdn -->
<script src="https://cdn.tailwindcss.com"></script>
<script
src="https://unpkg.com/htmx.org@1.9.3"
integrity="sha384-lVb3Rd/Ca0AxaoZg5sACe8FJKF0tnUgR2Kd7ehUOG5GCcROv5uBIZsOqovBAcWua"
crossorigin="anonymous"
></script>
</head>

<body class="flex items-center justify-center h-screen">
<div class="text-center">
<h1 class="text-2xl font-bold">Hello, Wing</h1>

<div id="hello" class="mt-4"></div>
</div>
</body>
</html>