In an umbrella, there is an elixir app that encapsulates the business logic for a prototype project.
Still in early phase, some “stakeholders” can benefit from a simple form where they can:
experiment with inserting in-/valid inputs
see the outputs that the business logic app returns
For this purpose, creating a new Phoenix web project within the umbrella project seems to fit:
$ mix phx.new.web foo --no-brunch
Changing into the new app directory and running mix phx.server successfully displays the Welcome to Phoenix! page. When running mix test though, the following error is returned:
** (Mix) Could not load Foo.Repo, error: :nofile. Please configure your app accordingly or pass a repo with the -r option.
Looks like it is not: it only contains only the content generated by default:
# …/apps/foo/config/test.exs
use Mix.Config
# We don't run a server during test. If one is required,
# you can enable the server option below.
config :test_harness, TestHarness.Endpoint,
http: [port: 4001],
server: false
Given the required simplicity – a simple form – how can this be configured such that it does not require a connection to the DB?
Searched the generated codebase for all references to Foo.Repo and commented out the respective chunks of logic. This seems to have worked, thank you!
As for the --no-ecto flag, it is not an option in this case: Ecto is needed for schemas and validation. It’s just the database layer (Repo?) that is unnecessary.