Skip to content

A simple example to develop front-end app with Vite and SolidJS as well as Fastify backend support through Vite's `server.proxy` config, and bundled with Rollup.

Notifications You must be signed in to change notification settings

just-shadyumbrella/vite-solid-fastify

Repository files navigation

Vite + Solid ~ Rollup + Fastify

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.

Usage

npm install # or pnpm install or yarn install

Start backend server (first) and Vite dev server

npm run dev:backend

# Open seperate terminal
npm run dev

Build

npm run build

Or run this separately

# Client
npm run build:client

# Server
npm run build:server

You 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

Deployment

Learn more about deploying your application with the documentations

About

A simple example to develop front-end app with Vite and SolidJS as well as Fastify backend support through Vite's `server.proxy` config, and bundled with Rollup.

Topics

Resources

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •