doesitarm/scripts/scan-new-apps.js
2022-09-04 10:13:57 -05:00

34 lines
709 B
JavaScript

import { createServer } from 'vite'
import axios from 'axios'
import viteConfig from '~/vite.config.mjs'
import { isLinux } from '~/helpers/environment.js'
const port = 1337
;(async () => {
// Disable on linu(server environments)
if ( 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 http://localhost:${ port }/`)
const { data } = await axios.get(`http://localhost:${ port }/`)
console.log( data.slice(0, 100) )
await server.close();
process.exit()
})()