Initial commit: Dostalgia — DOS game hub
- Go backend (single binary) with embedded Svelte frontend - JSON-per-game storage (no database) - .jsdos bundle creation on upload - Dark phosphor-green theme (#33FF33) - js-dos v8 emulator integration - Sockdrive support for games >80MB - IGDB placeholder for future artwork scraping - Docker deployment ready
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package main
|
||||
|
||||
import "net/http"
|
||||
|
||||
// handleIGDBSearch handles GET /api/igdb/search — placeholder.
|
||||
// Once IGDB credentials are configured, this will query the Twitch API.
|
||||
func handleIGDBSearch(w http.ResponseWriter, r *http.Request) {
|
||||
query := r.URL.Query().Get("q")
|
||||
if query == "" {
|
||||
http.Error(w, "Query parameter 'q' required", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
// TODO: Implement real IGDB search.
|
||||
// Requires TWITCH_CLIENT_ID and TWITCH_CLIENT_SECRET environment variables.
|
||||
//
|
||||
// Flow:
|
||||
// 1. POST https://id.twitch.tv/oauth2/token for access token
|
||||
// 2. POST https://api.igdb.com/v4/games with body: search "{query}"; fields name,cover.*,genres.*,screenshots.*;
|
||||
// 3. Resolve cover URLs → https://images.igdb.com/igdb/image/upload/t_cover_big/{image_id}.jpg
|
||||
// 4. Return matches
|
||||
|
||||
writeJSON(w, http.StatusOK, []map[string]string{
|
||||
{
|
||||
"message": "IGDB integration not yet configured. Set TWITCH_CLIENT_ID and TWITCH_CLIENT_SECRET env vars.",
|
||||
"query": query,
|
||||
},
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user