You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Add try/catch error handling for repo creation with 409 conflict response
- Clarify returned values and their purposes
- Add bullet points explaining name and token fields
- Add step to switch to Worker directory before deploy
- Improve explanations throughout the guide
const status =message.includes("already exists") ?409:500;
134
+
returnResponse.json({ error: message }, { status });
135
+
}
130
136
}
131
137
132
138
returnnewResponse("Use POST /repos to create an Artifacts repo.", {
@@ -139,7 +145,7 @@ export default {
139
145
140
146
</TypeScriptExample>
141
147
142
-
This Worker does one job: create an Artifacts repo and return the values your Git client needs next.
148
+
This Worker creates an Artifacts repo and returns the remote URL and token your Git client needs to push and pull.
143
149
144
150
:::caution[Protect token-issuing routes]
145
151
This example omits authentication so it can focus on the Artifacts flow. In production, authorize the caller before creating repos or returning write tokens.
Create a local repository and push it to Artifacts:
213
+
In the previous step, your Worker created an empty Artifacts repo. Now you'll create a local Git repo, add a file, and push it to Artifacts — the same way you'd push to any Git remote.
0 commit comments