The Echo application is designed using the Ruby on Rails framework. It responds to dynamic requests by matching predefined endpoints stored in the database. When a request matches a defined endpoint, the application returns a custom response with headers, status code, and body based on the endpoint configuration. If no matching endpoint is found, it returns a 404 with a "Endpoint not found" error message.
- Enter the project directory:
cd project-directory
- Install the specified gems:
bundle install
- Create the database:
rails db:create
- Run the database migrations:
rails db:migrate
- Start the Rails server:
rails s
The application will now be running at http://localhost:3000.
The Echo application uses RSpec for testing. Make sure the test database is created and migrated.
- To run all tests, follow these steps:
rspec spec
This will run all the tests within the spec folder.
-
Application cleanup - remove redundant parts of code after initialing Rails project
-
Refactor Model Validations - in order to keep the models small and maintainable, refactor complex validation methods, replace it with json-schema approach.