mix phx.server working

This commit is contained in:
Daniel Flanagan 2024-02-20 22:15:26 -06:00
parent 0f1131b406
commit 840cbe251c
Signed by: lytedev
GPG key ID: 5B2020A0F9921EF4
2 changed files with 19 additions and 18 deletions

25
main.ex
View file

@ -1,7 +1,18 @@
# application
defmodule Sfe do
defmodule Application do
use Elixir.Application
require Logger
def start(_type, _args) do
Logger.debug("Sfe starting...")
# config # config
counter = :counters.new(1, []) counter = :counters.new(1, [])
dbg(counter)
Application.put_env(:sfe, Sfe.Endpoint, Elixir.Application.put_env(:sfe, Sfe.Endpoint,
http: [ip: {127, 0, 0, 1}, port: 5001], http: [ip: {127, 0, 0, 1}, port: 5001],
pubsub_server: Sfe.PubSub, pubsub_server: Sfe.PubSub,
adapter: Bandit.PhoenixAdapter, adapter: Bandit.PhoenixAdapter,
@ -12,17 +23,7 @@ Application.put_env(:sfe, Sfe.Endpoint,
secret_key_base: String.duplicate("a", 64) secret_key_base: String.duplicate("a", 64)
) )
Application.put_env(:sfe, Sfe.HomeLive, counter_ref: counter) Elixir.Application.put_env(:sfe, Sfe.HomeLive, counter_ref: counter)
# application
defmodule Sfe do
defmodule Application do
use Elixir.Application
require Logger
def start(_type, _args) do
Logger.debug("Sfe starting...")
children = [ children = [
Sfe.Endpoint, Sfe.Endpoint,

View file

@ -17,7 +17,7 @@ and is used for nice things like code reloading by Phoenix, so not _quite_ as
So here ya go! So here ya go!
```bash ```bash
elixir main.ex mix phx.server
``` ```
Or if you want "hot reloading" Or if you want "hot reloading"