A simple example to develop front-end app with Vite and SolidJS, as well as Fastify back-end support through Vite's server.proxy config and bundled with Rollup.
npm install # or pnpm install or yarn installStart backend server (first) and Vite dev server
npm run dev:backend
# Open seperate terminal
npm run devnpm run buildOr run this separately
# Client
npm run build:client
# Server
npm run build:serverYou can now serve the production build with npm run preview. Or just run node . at dist folder, it's generally fully portable and minified by esbuild. You can adjust the build output by editing the vite.config.ts file for front-end and rollup.config.ts for back-end.
The API endpoint also works alongside Solid Router, including 404 and 500 error pages. Check out src/client/index.tsx and see how the Fastify server handles SPA requests in src/server/index.ts.
Learn more on the Solid Website and come chat with us on our Discord
Learn more about deploying your application with the documentations