mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Replace all in-scope axios callsites with a new helpers/http.js wrapper over native fetch, including JSON/text GET, JSON POST, HEAD checks, and transient 5xx retry behavior; update all browser, build, script, and proxy API clients to use it; add focused unit tests; and remove axios from package dependencies. Constraint: Preserve API/build and deployment behavior while lowering transport surface area. Rejected: inline fetch replacements at each callsite | rejected to avoid inconsistent error/retry semantics. Confidence: high Scope-risk: moderate Directive: Keep helper in place as the transport boundary and update tests when changing request semantics. Tested: pnpm run -s typecheck, pnpm -s run test-prebuild, pnpm -s run test, pnpm -s run test:browser, pnpm -s run netlify-build, smoke GETs on /apple-silicon-app-test and /apple-silicon-app-test/?version=2 Not-tested: branch/netlify deployment health in CI pipeline after merge
42 lines
952 B
JavaScript
42 lines
952 B
JavaScript
import { createServer } from 'vite'
|
|
|
|
import viteConfig from '~/vite.config.mjs'
|
|
import { isLinux } from '~/helpers/environment.js'
|
|
import { getText } from '~/helpers/http.js'
|
|
|
|
const port = 1337
|
|
|
|
// Example: doesitarm-cif09horl-samcarltoncreative.vercel.app
|
|
const vercelUrl = process.env.VERCEL_URL
|
|
|
|
const runScans = false
|
|
|
|
;(async () => {
|
|
|
|
// Disable on linux (server environments)
|
|
if ( !runScans || isLinux() ) return
|
|
|
|
// await scanNewAppsAsBrowser()
|
|
// http://localhost:3000/
|
|
const server = await createServer({
|
|
...viteConfig,
|
|
port
|
|
})
|
|
|
|
console.log( 'server', server )
|
|
|
|
await server.listen();
|
|
|
|
console.log(`Server listening on https://${ vercelUrl }:${ port }/`)
|
|
|
|
const data = await getText( `http://${ vercelUrl }:${ port }/` )
|
|
.catch( err => {
|
|
console.log( 'err', err )
|
|
})
|
|
|
|
console.log( data?.slice(0, 100) )
|
|
|
|
await server.close();
|
|
|
|
process.exit()
|
|
})()
|