[{"data":1,"prerenderedAt":362},["ShallowReactive",2],{"docs-\u002Fdocs\u002Fmain\u002Fdeployment":3},{"id":4,"title":5,"body":6,"description":349,"extension":350,"group":351,"meta":352,"navigation":353,"order":354,"path":355,"section":356,"seo":357,"source":358,"stem":359,"version":360,"__hash__":361},"docs\u002Fdocs\u002Fmain\u002Fdeployment.md","Deploy your application",{"type":7,"value":8,"toc":338},"minimark",[9,14,18,27,31,34,105,108,112,123,160,179,190,194,209,224,228,240,244,267,280,284,303,307,315,319,334],[10,11,13],"h2",{"id":12},"a-gonex-app-needs-a-backend-runtime","A Gonex app needs a backend runtime",[15,16,17],"p",{},"Gonex is a Go backend. Its compiled executable must run on a server, container platform or other host that supports a long-running Go process. GitHub Pages serves static files and cannot execute that backend.",[15,19,20,21,26],{},"If you use a static Nuxt\u002FVue frontend, you can host it on Pages while the Gonex API runs elsewhere. See ",[22,23,25],"a",{"href":24},"\u002Fdocs\u002Fmain\u002Ffrontend\u002F","frontend integration"," for the boundary.",[10,28,30],{"id":29},"build-the-application","Build the application",[15,32,33],{},"From your application module:",[35,36,41],"pre",{"className":37,"code":38,"language":39,"meta":40,"style":40},"language-sh shiki shiki-themes light-plus light-plus dark-plus","go mod tidy\ngo test .\u002F...\ngo tool gonex build --os linux --arch amd64\n# Output: dist\u002Flinux-amd64\u002Fshop\n","sh","",[42,43,44,60,71,98],"code",{"__ignoreMap":40},[45,46,49,53,57],"span",{"class":47,"line":48},"line",1,[45,50,52],{"class":51},"swoLU","go",[45,54,56],{"class":55},"sFD8J"," mod",[45,58,59],{"class":55}," tidy\n",[45,61,63,65,68],{"class":47,"line":62},2,[45,64,52],{"class":51},[45,66,67],{"class":55}," test",[45,69,70],{"class":55}," .\u002F...\n",[45,72,74,76,79,82,85,89,92,95],{"class":47,"line":73},3,[45,75,52],{"class":51},[45,77,78],{"class":55}," tool",[45,80,81],{"class":55}," gonex",[45,83,84],{"class":55}," build",[45,86,88],{"class":87},"stxUP"," --os",[45,90,91],{"class":55}," linux",[45,93,94],{"class":87}," --arch",[45,96,97],{"class":55}," amd64\n",[45,99,101],{"class":47,"line":100},4,[45,102,104],{"class":103},"sYH5r","# Output: dist\u002Flinux-amd64\u002Fshop\n",[15,106,107],{},"Deploy the compiled API binary and its explicit runtime configuration. Frontend assets are built and hosted separately.",[10,109,111],{"id":110},"configure-the-listening-address","Configure the listening address",[15,113,114,115,118,119,122],{},"The tutorial programs read ",[42,116,117],{},"HTTP_ADDRESS"," and pass it to ",[42,120,121],{},"config.Config",". For a platform that expects a listener on all interfaces, configure the address in the process environment before starting the application:",[35,124,126],{"className":37,"code":125,"language":39,"meta":40,"style":40},"DEBUG=false GONEX_ENV=production HTTP_ADDRESS=0.0.0.0:8080 .\u002Fdist\u002Flinux-amd64\u002Fshop\n",[42,127,128],{"__ignoreMap":40},[45,129,130,134,138,141,144,146,149,152,154,157],{"class":47,"line":48},[45,131,133],{"class":132},"sswaR","DEBUG",[45,135,137],{"class":136},"s_Yst","=",[45,139,140],{"class":55},"false",[45,142,143],{"class":132}," GONEX_ENV",[45,145,137],{"class":136},[45,147,148],{"class":55},"production",[45,150,151],{"class":132}," HTTP_ADDRESS",[45,153,137],{"class":136},[45,155,156],{"class":55},"0.0.0.0:8080",[45,158,159],{"class":51}," .\u002Fdist\u002Flinux-amd64\u002Fshop\n",[15,161,162,163,166,167,170,171,174,175,178],{},"This is POSIX shell syntax. On PowerShell, set ",[42,164,165],{},"$env:GONEX_ENV = 'production'"," and ",[42,168,169],{},"$env:HTTP_ADDRESS = '0.0.0.0:8080'",", also set ",[42,172,173],{},"$env:DEBUG = 'false'",", then start the Windows executable built for the server architecture. Bind only to interfaces appropriate for your deployment; use ",[42,176,177],{},"127.0.0.1:8080"," when a local reverse proxy should be the only entry point.",[15,180,181,182,185,186,189],{},"Gonex does not automatically load ",[42,183,184],{},".env"," files. Your executable or process manager owns environment\u002Fconfiguration loading. The default ",[42,187,188],{},"config.Config{}"," listener is loopback-only.",[10,191,193],{"id":192},"configure-https-and-frontend-routing","Configure HTTPS and frontend routing",[15,195,196,197,200,201,204,205,208],{},"Terminate HTTPS with your platform or reverse proxy. For a separate frontend on the same origin, serve the frontend at ",[42,198,199],{},"\u002F"," and forward ",[42,202,203],{},"\u002Fapi\u002F"," to the Gonex listener while preserving its ",[42,206,207],{},"\u002Fapi"," prefix. For a different-origin frontend, configure the backend's allowed CORS origin and the frontend's public API URL.",[15,210,211,212,215,216,219,220,223],{},"Decide whether ",[42,213,214],{},"\u002Fopenapi.json"," should be public. Set ",[42,217,218],{},"DisableOpenAPI"," in the application configuration when it should not be exposed. For generated CLI applications, use their documented ",[42,221,222],{},"GONEX_DISABLE_OPENAPI"," option.",[10,225,227],{"id":226},"production-logs","Production logs",[15,229,230,231,234,235,239],{},"Set ",[42,232,233],{},"GONEX_ENV=production"," in the generated application to select JSON logs by default. Collect stderr through your platform; configure level\u002Fformat using the ",[22,236,238],{"href":237},"\u002Fdocs\u002Fmain\u002Flogging\u002F","logging guide",". The localhost startup URL is a local convenience, not your public HTTPS origin.",[10,241,243],{"id":242},"health-readiness-and-shutdown","Health, readiness and shutdown",[245,246,247,255,261,264],"ul",{},[248,249,250,251,254],"li",{},"Use ",[42,252,253],{},"\u002Fhealthz"," for the lightweight health response.",[248,256,250,257,260],{},[42,258,259],{},"\u002Freadyz"," for application\u002Fdependency readiness.",[248,262,263],{},"Send a normal termination signal and allow the configured shutdown budget to drain work.",[248,265,266],{},"Make managed resources honor context cancellation.",[15,268,269,270,274,275,279],{},"Review ",[22,271,273],{"href":272},"\u002Fdocs\u002Fmain\u002Foperations\u002F","operations"," for readiness and resource lifecycles. Apply ",[22,276,278],{"href":277},"\u002Fdocs\u002Fmain\u002Fsecurity\u002F","security configuration"," before exposing the app.",[10,281,283],{"id":282},"databases-and-version-pinning","Databases and version pinning",[15,285,286,287,290,291,293,294,297,298,302],{},"Run explicit migrations before starting the application. Set the database environment expected by your executable; serving does not automatically migrate schemas. Do not deploy a ",[42,288,289],{},"go.mod"," that points to a developer machine's absolute replacement path. Keep the reviewed framework version in ",[42,292,289],{}," \u002F ",[42,295,296],{},"go.sum",", and review ",[22,299,301],{"href":300},"\u002Fdocs\u002Fmain\u002Fupgrades\u002F","upgrade compatibility"," before changing it.",[10,304,306],{"id":305},"current-release-status","Current release status",[15,308,309,310,314],{},"The documentation snapshot has no published stable release. Source availability and successful local examples do not establish a production support guarantee. Review the ",[22,311,313],{"href":312},"\u002Fdocs\u002Fmain\u002Frelease\u002F","release status"," and verify your deployment environment.",[10,316,318],{"id":317},"disable-development-pages","Disable development pages",[15,320,230,321,324,325,328,329,333],{},[42,322,323],{},"DEBUG=false"," explicitly. Debug mode defaults off but can expose original errors and stack traces when enabled. It is independent of ",[42,326,327],{},"GONEX_ENV",". The welcome page and embedded duck are unavailable when debug is off. See ",[22,330,332],{"href":331},"\u002Fdocs\u002Fmain\u002Fdebug\u002F","debug mode",".",[335,336,337],"style",{},"html pre.shiki code .swoLU, html code.shiki .swoLU{--shiki-light:#795E26;--shiki-default:#795E26;--shiki-dark:#DCDCAA}html pre.shiki code .sFD8J, html code.shiki .sFD8J{--shiki-light:#A31515;--shiki-default:#A31515;--shiki-dark:#CE9178}html pre.shiki code .stxUP, html code.shiki .stxUP{--shiki-light:#0000FF;--shiki-default:#0000FF;--shiki-dark:#569CD6}html pre.shiki code .sYH5r, html code.shiki .sYH5r{--shiki-light:#008000;--shiki-default:#008000;--shiki-dark:#6A9955}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sswaR, html code.shiki .sswaR{--shiki-light:#001080;--shiki-default:#001080;--shiki-dark:#9CDCFE}html pre.shiki code .s_Yst, html code.shiki .s_Yst{--shiki-light:#000000;--shiki-default:#000000;--shiki-dark:#D4D4D4}",{"title":40,"searchDepth":62,"depth":62,"links":339},[340,341,342,343,344,345,346,347,348],{"id":12,"depth":62,"text":13},{"id":29,"depth":62,"text":30},{"id":110,"depth":62,"text":111},{"id":192,"depth":62,"text":193},{"id":226,"depth":62,"text":227},{"id":242,"depth":62,"text":243},{"id":282,"depth":62,"text":283},{"id":305,"depth":62,"text":306},{"id":317,"depth":62,"text":318},"Build and host a Gonex JSON API as a Go service, with explicit configuration, readiness and frontend hosting.","md","SHIP YOUR APP",{},true,140,"\u002Fdocs\u002Fmain\u002Fdeployment","build",{"title":5,"description":349},null,"docs\u002Fmain\u002Fdeployment","main","zTn6dhvdJ1yD5FzCqrDGZbGQppQSpHAXlEbaMieP9SY",1792521640562]