mirror of
https://onedev.site.tesses.net/crosslang/crosslangextras
synced 2026-02-08 09:05:46 +00:00
Add api for versions
This commit is contained in:
@@ -226,6 +226,23 @@ func main(args)
|
|||||||
ctx.WithMimeType("text/html").SendText(Pages.API.V1());
|
ctx.WithMimeType("text/html").SendText(Pages.API.V1());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if(ctx.Path == "/api/v1/versions")
|
||||||
|
{
|
||||||
|
var name = ctx.QueryParams.TryGetFirst("name");
|
||||||
|
if(TypeOf(name) == "String")
|
||||||
|
{
|
||||||
|
var versions = DB.GetPackageVersions(name);
|
||||||
|
ctx.WithMimeType("application/json").SendJson({
|
||||||
|
success=true,
|
||||||
|
versions
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
ctx.WithMimeType("application/json").SendJson({
|
||||||
|
success=false
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if(ctx.Path == "/api/v1/upload")
|
if(ctx.Path == "/api/v1/upload")
|
||||||
{
|
{
|
||||||
if(ctx.Method == "PUT")
|
if(ctx.Method == "PUT")
|
||||||
|
|||||||
Reference in New Issue
Block a user