Skip to content

andrijzyn/RailsAsAPI-CORS

Repository files navigation

Conducting a test of the Ruby on Rails server through CORS and the Vite + Vue frontend

1

Project Setup

Prerequisites

  • Ruby and Node.js installed
  • Bundler and npm (or yarn) installed globally

Installation

  1. Clone the repository:

    git clone https://github.com/andrijzyn/RailsAsAPI-CORS.git
  2. Navigate to the project directory:

    cd RailsAsAPI-CORS
  3. Install Ruby dependencies:

    bundle install
  4. Install JavaScript dependencies:

    yarn install

Database Setup

  • Run migrations:
    bin/rails db:migrate

Running the Development Server

  1. Start the Rails server:

    bin/rails server -b 0.0.0.0 -p 3000 -e development
  2. Start the frontend development server:

    npm run dev

Building for Production

  • Precompile assets:
    RAILS_ENV=production bin/rails assets:precompile