From b756a5305622e6e60cd10411b685084d326393f4 Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Sun, 21 Aug 2022 08:59:36 -0500 Subject: [PATCH] Add scan-new-apps script --- package.json | 1 + scripts/scan-new-apps.js | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 scripts/scan-new-apps.js diff --git a/package.json b/package.json index 9bc9e3f..59ce46d 100644 --- a/package.json +++ b/package.json @@ -47,6 +47,7 @@ "lint:fix": "eslint --fix --ext .js,.vue --ignore-path .gitignore .", "precommit": "npm run lint", "clone-readme": "cp ./README.md README-temp.md", + "scan-new-apps": "npx vite-node scripts/scan-new-apps.js", "cloudflare-deploy": "npm run build-api", "vercel-build": "run-s test-prebuild build-lists-and-api test-postbuild-api", "netlify-build": "run-s test-prebuild-functions download-sitemaps stork-index generate-astro test-postbuild-functions test-circular-deps" diff --git a/scripts/scan-new-apps.js b/scripts/scan-new-apps.js new file mode 100644 index 0000000..209d7a5 --- /dev/null +++ b/scripts/scan-new-apps.js @@ -0,0 +1,24 @@ +import { createServer } from 'vite' +import axios from 'axios' + +import viteConfig from '~/vite.config.mjs' + +;(async () => { + // await scanNewAppsAsBrowser() + // http://localhost:3000/ + const server = await createServer({ + ...viteConfig, + }) + + await server.listen(); + + console.log('Server listening on http://localhost:3000/') + + const { data } = await axios.get('http://localhost:3000/') + + console.log( data.slice(0, 100) ) + + await server.close(); + + process.exit() +})()