Add OPTIONS routes for new generation endpoints in Neo API

- Registered new OPTIONS routes for /generate, /generate/title, and /generate/prompts in the Neo API, enhancing CORS support for the recently introduced generation functionalities.
- This update ensures that the API can handle preflight requests for these endpoints, improving overall API usability and compliance with CORS standards.
This commit is contained in:
Max 2024-12-19 15:16:08 +08:00
parent 375ad96e9d
commit fc1cbb2457

View file

@ -36,6 +36,9 @@ func (neo *DSL) API(router *gin.Engine, path string) error {
router.OPTIONS(path+"/upload", neo.optionsHandler)
router.OPTIONS(path+"/download", neo.optionsHandler)
router.OPTIONS(path+"/mentions", neo.optionsHandler)
router.OPTIONS(path+"/generate", neo.optionsHandler)
router.OPTIONS(path+"/generate/title", neo.optionsHandler)
router.OPTIONS(path+"/generate/prompts", neo.optionsHandler)
router.OPTIONS(path+"/dangerous/clear_chats", neo.optionsHandler)
// Register endpoints with middlewares