mirror of
https://github.com/geoffsee/open-gsio.git
synced 2025-09-08 22:56:46 +00:00
**Migrate from TOML to JSON configuration for workers**
Replaced Wrangler TOML files with JSON configuration for email and analytics workers, updating compatibility dates and maintaining existing settings. Updated email metadata and replaced hardcoded email addresses with example addresses for better abstraction. Adjusted deployment scripts in `package.json` to align with the new worker structure.
This commit is contained in:

committed by
Geoff Seemueller

parent
d0d55f58a6
commit
fb7031fc89
@@ -9,8 +9,8 @@
|
||||
"client:build": "vite build",
|
||||
"server:build": "WRANGLER_LOG=info wrangler build",
|
||||
"deploy": "CI=true vite build && wrangler deploy --minify",
|
||||
"deploy:email-service": "wrangler deploy -c workers/email/wrangler-email.toml",
|
||||
"deploy:analytics-service": "wrangler deploy -c workers/analytics/wrangler-analytics.toml",
|
||||
"deploy:email-service": "wrangler deploy --cwd workers/email",
|
||||
"deploy:analytics-service": "wrangler deploy --cwd workers/analytics",
|
||||
"tail": "wrangler tail",
|
||||
"tail:email-service": "wrangler tail -c workers/email/wrangler-email.toml",
|
||||
"tail:analytics-service": "wrangler tail -c workers/analytics/wrangler-analytics.toml",
|
||||
|
@@ -37,7 +37,7 @@ const onRenderHtml: OnRenderHtmlAsync = async (
|
||||
<meta charset="UTF-8">
|
||||
<meta name="description" content="Maker Site">
|
||||
<script>
|
||||
window.ga_tid = "resume-site";
|
||||
window.ga_tid = "open-gsio";
|
||||
window.ga_api = "/api/metrics";
|
||||
</script>
|
||||
<script src="/cfga.min.js" async></script>
|
||||
|
@@ -1,17 +0,0 @@
|
||||
main="analytics_worker.js"
|
||||
name = "analytics"
|
||||
compatibility_date = "2024-12-20"
|
||||
|
||||
routes = [
|
||||
{ pattern = "metrics.seemueller.io", custom_domain = true }
|
||||
]
|
||||
|
||||
[dev]
|
||||
port = 3003
|
||||
|
||||
[placement]
|
||||
mode = "smart"
|
||||
|
||||
[[analytics_engine_datasets]]
|
||||
binding = "ANALYTICS_ENGINE"
|
||||
dataset = "global_analytics"
|
23
workers/analytics/wrangler.jsonc
Normal file
23
workers/analytics/wrangler.jsonc
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compatibility_date": "2025-05-27",
|
||||
"main": "analytics_worker.js",
|
||||
"name": "analytics",
|
||||
"analytics_engine_datasets": [
|
||||
{
|
||||
"binding": "ANALYTICS_ENGINE",
|
||||
"dataset": "global_analytics"
|
||||
}
|
||||
],
|
||||
"routes": [
|
||||
{
|
||||
"custom_domain": true,
|
||||
"pattern": "your.route.here"
|
||||
}
|
||||
],
|
||||
"dev": {
|
||||
"port": 3003
|
||||
},
|
||||
"placement": {
|
||||
"mode": "smart"
|
||||
}
|
||||
}
|
@@ -14,7 +14,7 @@ export default class EmailWorker extends WorkerEntrypoint {
|
||||
const msg = createMimeMessage();
|
||||
msg.setSender({
|
||||
name: "New Website Contact",
|
||||
addr: "contact@seemueller.io",
|
||||
addr: "contact@example.com",
|
||||
});
|
||||
console.log("Recipient:", to);
|
||||
// msg.setRecipient(to);
|
||||
@@ -27,8 +27,8 @@ export default class EmailWorker extends WorkerEntrypoint {
|
||||
|
||||
try {
|
||||
const message = new EmailMessage(
|
||||
"contact@seemueller.io",
|
||||
"geoff@seemueller.io",
|
||||
"contact@example.com",
|
||||
"team@example.com",
|
||||
msg.asRaw(),
|
||||
);
|
||||
await this.env.SEB.send(message);
|
||||
|
@@ -1,14 +0,0 @@
|
||||
main="email_worker.js"
|
||||
name = "email-service-rpc"
|
||||
compatibility_date = "2024-12-20"
|
||||
node_compat = true
|
||||
|
||||
[dev]
|
||||
port = 3002
|
||||
|
||||
[placement]
|
||||
mode = "smart"
|
||||
|
||||
send_email = [
|
||||
{name = "SEB", destination_address = "contact@seemueller.io"},
|
||||
]
|
18
workers/email/wrangler.jsonc
Normal file
18
workers/email/wrangler.jsonc
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"compatibility_date": "2025-05-27",
|
||||
"main": "email_worker.js",
|
||||
"name": "email-service-rpc",
|
||||
"node_compat": true,
|
||||
"dev": {
|
||||
"port": 3002
|
||||
},
|
||||
"placement": {
|
||||
"mode": "smart",
|
||||
"send_email": [
|
||||
{
|
||||
"destination_address": "contact@example.com",
|
||||
"name": "SEB"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user