This commit is contained in:
2024-09-11 22:41:17 -03:00
parent 3cefdd8f38
commit 2dd0587393
17 changed files with 131 additions and 38 deletions

View File

@ -1,32 +1,51 @@
# SQLite. Versions 3.8.0 and up are supported.
# gem install sqlite3
# MySQL. Versions 5.5.8 and up are supported.
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem "sqlite3"
# Install the MySQL driver
# gem install mysql2
#
# Ensure the MySQL gem is defined in your Gemfile
# gem "mysql2"
#
# And be sure to use new-style password hashing:
# https://dev.mysql.com/doc/refman/5.7/en/password-hashing.html
#
default: &default
adapter: sqlite3
adapter: mysql2
encoding: utf8mb4
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
timeout: 5000
username: <%= ENV.fetch("DB_USER") {"root"} %>
password: <%= ENV.fetch("DB_PASSWORD") {""} %>
database: <%= ENV.fetch("DB_NAME") %>
host: <%= ENV.fetch("DB_HOST") { "localhost" } %>
development:
<<: *default
database: storage/development.sqlite3
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
<<: *default
database: storage/test.sqlite3
# SQLite3 write its data on the local filesystem, as such it requires
# persistent disks. If you are deploying to a managed service, you should
# make sure it provides disk persistence, as many don't.
# As with config/credentials.yml, you never want to store sensitive information,
# like your database password, in your source code. If your source code is
# ever seen by anyone, they now have access to your database.
#
# Instead, provide the password or a full connection URL as an environment
# variable when you boot the app. For example:
#
# DATABASE_URL="mysql2://myuser:mypass@localhost/somedatabase"
#
# If the connection URL is provided in the special DATABASE_URL environment
# variable, Rails will automatically merge its configuration values on top of
# the values provided in this file. Alternatively, you can specify a connection
# URL environment variable explicitly:
#
# production:
# url: <%= ENV["MY_APP_DATABASE_URL"] %>
#
# Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
# for a full overview on how database connection configuration can be specified.
#
# Similarly, if you deploy your application as a Docker container, you must
# ensure the database is located in a persisted volume.
production:
<<: *default
# database: path/to/persistent/storage/production.sqlite3

View File

@ -1,4 +1,6 @@
Rails.application.routes.draw do
get "/ruta", to: 'ruta#get'
post "/ruta", to: 'ruta#add'
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
# Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500.