Bladeren bron

Document running in development mode

theenglishway (time) 4 jaren geleden
bovenliggende
commit
25310530f2
2 gewijzigde bestanden met toevoegingen van 26 en 10 verwijderingen
  1. 24 8
      README.md
  2. 2 2
      config/dev.exs

+ 24 - 8
README.md

@@ -11,15 +11,31 @@ of mine in the aspects of build, integration and deployment.
 * [] Handle the current version via a git tag
 * [] Build as `dev` or `prod`
 
-## Initial documentation
+## Preconditions
 
-To start your Phoenix server:
+### PostgreSQL role
 
-  * Install dependencies with `mix deps.get`
-  * Create and migrate your database with `mix ecto.setup`
-  * Install Node.js dependencies with `npm install` inside the `assets` directory
-  * Start Phoenix endpoint with `mix phx.server`
+In `dev` as well as in `prod` modes, the role used in `config/#{mode}.exs` must 
+be created using e.g. the command line : `sudo -u postgres createuser -P role_name`
 
-Now you can visit [`localhost:4000`](http://localhost:4000) from your browser.
+(add `-d` flag to allow database creation)
 
-Ready to run in production? Please [check our deployment guides](https://hexdocs.pm/phoenix/deployment.html).
+### PostgreSQL database
+
+In `dev` as well as in `prod` modes, the role used in `config/#{mode}.exs` must 
+be created using e.g. the command line : `sudo -u postgres createdb -O role_name db_name`
+
+## Running the server
+
+### In development mode
+
+The PostgreSQL role/database must be installed, if required.
+
+To start the server in dev mode : 
+  
+* Install dependencies with `mix deps.get`
+* Install Node.js dependencies with `mix cmd npm install --prefix assets`
+* Start the server : `mix phx.server` or `iex -S mix phx.server` to run within a shell
+
+The server can now be accessed on [`localhost:4000`](http://localhost:4000).
+ 

+ 2 - 2
config/dev.exs

@@ -2,8 +2,8 @@ use Mix.Config
 
 # Configure your database
 config :toy, Toy.Repo,
-  username: "postgres",
-  password: "postgres",
+  username: "toy",
+  password: "toy",
   database: "toy_dev",
   hostname: "localhost",
   show_sensitive_data_on_connection_error: true,