Move API endpoints under an API url namespace. Closes #148
This commit is contained in:
@@ -21,20 +21,20 @@ func Start() error {
|
|||||||
http.HandleFunc("/", controllers.IndexHandler)
|
http.HandleFunc("/", controllers.IndexHandler)
|
||||||
|
|
||||||
// status of the system
|
// status of the system
|
||||||
http.HandleFunc("/status", controllers.GetStatus)
|
http.HandleFunc("/api/status", controllers.GetStatus)
|
||||||
|
|
||||||
// custom emoji supported in the chat
|
// custom emoji supported in the chat
|
||||||
http.HandleFunc("/emoji", controllers.GetCustomEmoji)
|
http.HandleFunc("/api/emoji", controllers.GetCustomEmoji)
|
||||||
|
|
||||||
if !config.Config.DisableWebFeatures {
|
if !config.Config.DisableWebFeatures {
|
||||||
// websocket chat server
|
// websocket chat server
|
||||||
go chat.Start()
|
go chat.Start()
|
||||||
|
|
||||||
// chat rest api
|
// chat rest api
|
||||||
http.HandleFunc("/chat", controllers.GetChatMessages)
|
http.HandleFunc("/api/chat", controllers.GetChatMessages)
|
||||||
|
|
||||||
// web config api
|
// web config api
|
||||||
http.HandleFunc("/config", controllers.GetWebConfig)
|
http.HandleFunc("/api/config", controllers.GetWebConfig)
|
||||||
|
|
||||||
// chat embed
|
// chat embed
|
||||||
http.HandleFunc("/embed/chat", controllers.GetChatEmbed)
|
http.HandleFunc("/embed/chat", controllers.GetChatEmbed)
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
// misc constants used throughout the app
|
// misc constants used throughout the app
|
||||||
|
|
||||||
export const URL_STATUS = `/status`;
|
export const URL_STATUS = `/api/status`;
|
||||||
export const URL_CHAT_HISTORY = `/chat`;
|
export const URL_CHAT_HISTORY = `/api/chat`;
|
||||||
export const URL_CUSTOM_EMOJIS = `/emoji`;
|
export const URL_CUSTOM_EMOJIS = `/api/emoji`;
|
||||||
export const URL_CONFIG = `/config`;
|
export const URL_CONFIG = `/api/config`;
|
||||||
|
|
||||||
// TODO: This directory is customizable in the config. So we should expose this via the config API.
|
// TODO: This directory is customizable in the config. So we should expose this via the config API.
|
||||||
export const URL_STREAM = `/hls/stream.m3u8`;
|
export const URL_STREAM = `/hls/stream.m3u8`;
|
||||||
|
|||||||
Reference in New Issue
Block a user