From 033d07a519bac03fdfd28ca15e09cc287e80fd14 Mon Sep 17 00:00:00 2001 From: neodarz Date: Tue, 24 Jan 2017 17:09:18 +0100 Subject: Initial commit with non-functional pieces of code about file upload --- config/config.exs | 27 ++++++++++++++++++++++++ config/dev.exs | 43 +++++++++++++++++++++++++++++++++++++++ config/prod.exs | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ config/test.exs | 19 +++++++++++++++++ 4 files changed, 150 insertions(+) create mode 100644 config/config.exs create mode 100644 config/dev.exs create mode 100644 config/prod.exs create mode 100644 config/test.exs (limited to 'config') diff --git a/config/config.exs b/config/config.exs new file mode 100644 index 0000000..07cafbd --- /dev/null +++ b/config/config.exs @@ -0,0 +1,27 @@ +# This file is responsible for configuring your application +# and its dependencies with the aid of the Mix.Config module. +# +# This configuration file is loaded before any dependency and +# is restricted to this project. +use Mix.Config + +# General application configuration +config :the_transcriber_backend, + ecto_repos: [TheTranscriberBackend.Repo] + +# Configures the endpoint +config :the_transcriber_backend, TheTranscriberBackend.Endpoint, + url: [host: "localhost"], + secret_key_base: "0yJGL4kD9IVayiDhe0WXbB5tavo4cap0+zNWqjT3LRfFC5bbyCWz9wrttCkhi1lw", + render_errors: [view: TheTranscriberBackend.ErrorView, accepts: ~w(html json)], + pubsub: [name: TheTranscriberBackend.PubSub, + adapter: Phoenix.PubSub.PG2] + +# Configures Elixir's Logger +config :logger, :console, + format: "$time $metadata[$level] $message\n", + metadata: [:request_id] + +# Import environment specific config. This must remain at the bottom +# of this file so it overrides the configuration defined above. +import_config "#{Mix.env}.exs" diff --git a/config/dev.exs b/config/dev.exs new file mode 100644 index 0000000..4fc5b59 --- /dev/null +++ b/config/dev.exs @@ -0,0 +1,43 @@ +use Mix.Config + +# For development, we disable any cache and enable +# debugging and code reloading. +# +# The watchers configuration can be used to run external +# watchers to your application. For example, we use it +# with brunch.io to recompile .js and .css sources. +config :the_transcriber_backend, TheTranscriberBackend.Endpoint, + http: [port: 4000], + debug_errors: true, + code_reloader: true, + check_origin: false, + watchers: [node: ["node_modules/brunch/bin/brunch", "watch", "--stdin", + cd: Path.expand("../", __DIR__)]] + + +# Watch static and templates for browser reloading. +config :the_transcriber_backend, TheTranscriberBackend.Endpoint, + live_reload: [ + patterns: [ + ~r{priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$}, + ~r{priv/gettext/.*(po)$}, + ~r{web/views/.*(ex)$}, + ~r{web/templates/.*(eex)$} + ] + ] + +# Do not include metadata nor timestamps in development logs +config :logger, :console, format: "[$level] $message\n" + +# Set a higher stacktrace during development. Avoid configuring such +# in production as building large stacktraces may be expensive. +config :phoenix, :stacktrace_depth, 20 + +# Configure your database +config :the_transcriber_backend, TheTranscriberBackend.Repo, + adapter: Ecto.Adapters.Postgres, + username: "postgres", + password: "postgres", + database: "the_transcriber_backend_dev", + hostname: "localhost", + pool_size: 10 diff --git a/config/prod.exs b/config/prod.exs new file mode 100644 index 0000000..2ebca1c --- /dev/null +++ b/config/prod.exs @@ -0,0 +1,61 @@ +use Mix.Config + +# For production, we configure the host to read the PORT +# from the system environment. Therefore, you will need +# to set PORT=80 before running your server. +# +# You should also configure the url host to something +# meaningful, we use this information when generating URLs. +# +# Finally, we also include the path to a manifest +# containing the digested version of static files. This +# manifest is generated by the mix phoenix.digest task +# which you typically run after static files are built. +config :the_transcriber_backend, TheTranscriberBackend.Endpoint, + http: [port: {:system, "PORT"}], + url: [host: "example.com", port: 80], + cache_static_manifest: "priv/static/manifest.json" + +# Do not print debug messages in production +config :logger, level: :info + +# ## SSL Support +# +# To get SSL working, you will need to add the `https` key +# to the previous section and set your `:url` port to 443: +# +# config :the_transcriber_backend, TheTranscriberBackend.Endpoint, +# ... +# url: [host: "example.com", port: 443], +# https: [port: 443, +# keyfile: System.get_env("SOME_APP_SSL_KEY_PATH"), +# certfile: System.get_env("SOME_APP_SSL_CERT_PATH")] +# +# Where those two env variables return an absolute path to +# the key and cert in disk or a relative path inside priv, +# for example "priv/ssl/server.key". +# +# We also recommend setting `force_ssl`, ensuring no data is +# ever sent via http, always redirecting to https: +# +# config :the_transcriber_backend, TheTranscriberBackend.Endpoint, +# force_ssl: [hsts: true] +# +# Check `Plug.SSL` for all available options in `force_ssl`. + +# ## Using releases +# +# If you are doing OTP releases, you need to instruct Phoenix +# to start the server for all endpoints: +# +# config :phoenix, :serve_endpoints, true +# +# Alternatively, you can configure exactly which server to +# start per endpoint: +# +# config :the_transcriber_backend, TheTranscriberBackend.Endpoint, server: true +# + +# Finally import the config/prod.secret.exs +# which should be versioned separately. +import_config "prod.secret.exs" diff --git a/config/test.exs b/config/test.exs new file mode 100644 index 0000000..d1290bc --- /dev/null +++ b/config/test.exs @@ -0,0 +1,19 @@ +use Mix.Config + +# We don't run a server during test. If one is required, +# you can enable the server option below. +config :the_transcriber_backend, TheTranscriberBackend.Endpoint, + http: [port: 4001], + server: false + +# Print only warnings and errors during test +config :logger, level: :warn + +# Configure your database +config :the_transcriber_backend, TheTranscriberBackend.Repo, + adapter: Ecto.Adapters.Postgres, + username: "postgres", + password: "postgres", + database: "the_transcriber_backend_test", + hostname: "localhost", + pool: Ecto.Adapters.SQL.Sandbox -- cgit v1.2.1