mirror of
https://onedev.site.tesses.net/crosslang/crosslangextras
synced 2026-02-09 01:25:46 +00:00
Get more done on packageserver
This commit is contained in:
14
Tesses.CrossLang.PackageServer/src/pages/api/api.tcross
Normal file
14
Tesses.CrossLang.PackageServer/src/pages/api/api.tcross
Normal file
@@ -0,0 +1,14 @@
|
||||
func Pages.API.Index()
|
||||
{
|
||||
var pages=[{
|
||||
active = true,
|
||||
route = "/api",
|
||||
text = "API Home"
|
||||
}];
|
||||
var html = <null>
|
||||
<h1>API Home</h1>
|
||||
<ul>
|
||||
<li><a href="./api-v1">v1</a></li>
|
||||
</ul></null>;
|
||||
return Shell("CPKG API Home", pages,html);
|
||||
}
|
||||
34
Tesses.CrossLang.PackageServer/src/pages/api/v1.tcross
Normal file
34
Tesses.CrossLang.PackageServer/src/pages/api/v1.tcross
Normal file
@@ -0,0 +1,34 @@
|
||||
func Pages.API.V1()
|
||||
{
|
||||
var pages=[{
|
||||
active = false,
|
||||
route = "/api",
|
||||
text = "API Home"
|
||||
}];
|
||||
var html = <null>
|
||||
<h1>API v1</h1>
|
||||
<ul>
|
||||
<li>
|
||||
GET /api/v1/package_icon.png?name=PACKAGENAME&version=1.0.0.0-prod<br>
|
||||
Gets the package icon for the package<br>
|
||||
<br>
|
||||
query:<br>
|
||||
<code>name</code>: the name of the package<br>
|
||||
<code>version</code>: the version of the package<br>
|
||||
<br>
|
||||
response: image/png of package
|
||||
</li>
|
||||
<li>
|
||||
GET /api/v1/latest?name=PACKAGENAME<br>
|
||||
Gets the latest version of a package<br>
|
||||
<br>
|
||||
query:<br>
|
||||
<code>name</code>: the name of the package<br>
|
||||
<br>
|
||||
response: json dictionary with a single key <code>version</code> with the string value of the latest version<br>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</null>;
|
||||
return Shell("CPKG API v1", pages,html);
|
||||
}
|
||||
Reference in New Issue
Block a user