Vite integration on pre-existing react project.. 404 but dev server running

This is the existing project: https://github.com/nnall/CRUDApps/tree/main/signup

Because the backend is already set up in my current project, I'm reluctant to scrap it and use npm create vite@latest to create a whole new react project through the vite command.

I merely want to integrate it, like an npm package, and run the vite server as my dev server, which I appear to be doing (see pic) according to the terminal output when I run this script: "start": "npx vite",.

But the browser at that address is giving me a 404 error.

This is my config file:
// vite.config.js
import { defineConfig } from "vite";
import React from "react";
import { VitePluginReact } from "@vitejs/plugin-react";

// https://vitejs.dev/config/
export default defineConfig({
  root: "./src", // Specify the root directory
  base: "/", // Specify the base URL
  plugins: [VitePluginReact()],
  alias: {
    // Update this with your actual entry file name
    "@": "./index.jsx",
  },
});


and the npm packages:

"dependencies": {
    "@react-three/drei": "^9.97.0",
    "@react-three/fiber": "^8.15.15",
    "@testing-library/jest-dom": "^5.17.0",
    "@testing-library/react": "^13.4.0",
    "@testing-library/user-event": "^13.5.0",
    "i": "^0.3.7",
    "node": "^21.2.0",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-native": "^0.73.2",
    "react-router-dom": "^6.21.2",
    "react-scripts": "5.0.1",
    "react-three-fiber": "^6.0.13",
    "sass": "^1.69.7",
    "three": "^0.160.1",
    "web-vitals": "^2.1.4"
  },
  "scripts": {
    "start": "npx vite",
    "build": "npx vite build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
Screenshot_2024-02-03_at_11.58.57_AM.png
GitHub
Server learning apps. Contribute to nnall/CRUDApps development by creating an account on GitHub.
CRUDApps/signup at main · nnall/CRUDApps
Was this page helpful?