Add deploy.sh endpoint and one-command installation flow
This commit is contained in:
1 parent
900f72a299
commit
1a9bf096f3
4 files changed
+102
-29
No files matched your search
@@ -120,3 +120,16 @@ pub async fn root_landing() -> Response {
|
||||
Err(_) => (StatusCode::NOT_FOUND, "Not Found").into_response(),
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn deploy_script() -> Response {
|
||||
match tokio::fs::read("www/deploy.sh").await {
|
||||
Ok(content) => (
|
||||
StatusCode::OK,
|
||||
[("content-type", "text/plain; charset=utf-8")],
|
||||
content,
|
||||
)
|
||||
.into_response(),
|
||||
|
||||
Err(_) => (StatusCode::NOT_FOUND, "deploy.sh not found").into_response(),
|
||||
}
|
||||
}
|
||||
@@ -38,6 +38,7 @@ pub fn create_router(state: AppState) -> Router {
|
||||
.route("/admin/pages/create", post(admin::pages_create))
|
||||
.route("/admin/pages/delete/:id", post(admin::pages_delete))
|
||||
.route("/admin/analytics/url/:id", get(admin::url_analytics_get))
|
||||
.route("/deploy.sh", get(pages::deploy_script))
|
||||
.route(
|
||||
"/admin/analytics/url/:id/export/csv",
|
||||
get(admin::url_analytics_csv_export),
|
||||
|
||||
Reference in new issue
Block a user