This conversion was actually done with phoenix master, the week before phoenix 4 released.
- Erlang 17.0
- Elixir 0.15.0
- Phoenix master, "55577a267a1635af3d19fb5c37381077bd25e484"
upstream app { | |
server 127.0.0.1:4000 fail_timeout=5s; | |
} | |
server { | |
listen 80 default_server; | |
server_name _; | |
root '/var/app/current/priv/static'; | |
If you're still on 0.4.x, follow [this 0.4x to 0.5.0 upgrade guide] (http://learnelixir.com/blog/2014/10/29/migrating-applications-from-phoenix-0-dot-4-1-to-phoenix-0-dot-5-0/), then head back over here.
Phoenix 0.6.0
brings some nice enhancements and a few backwards incompatible changes. The following steps should get your 0.5.x
apps up and running on the latest and greatest.
The Router no longer defines the default :browser
and :api
pipelines for you, but they remain the idiomatic defaults. You can copy the standard pipelines into your router:
(defun tester (&rest cl-keys) | |
(cl--parsing-keywords ((:function nil) (:match nil)) nil | |
(if (and buffer-file-name (string-match cl-match buffer-file-name)) | |
(setq tester--test-run-function cl-function) | |
(setq tester--test-run-function nil)))) | |
(defun tester--store-setup () | |
(setq tester--last-test-file buffer-file-name) | |
(setq tester--last-test-function tester--test-run-function)) |
# config/initializers/delayed_job_mongoid.rb | |
module Delayed | |
module Backend | |
module ActiveRecord | |
class Job < ::ActiveRecord::Base | |
def self.before_fork | |
::ActiveRecord::Base.clear_all_connections! | |
::Mongoid.master.connection.close | |
end |
guard 'shell', :elixirc_bin => "/usr/local/elixirc" do | |
watch(/(.+\.ex$)/) { |m| `elixirc #{m[0]}` } | |
end | |
guard 'shell', :elixir_bin => "/usr/local/elixir" do | |
watch(/(.+\.exs$)/) { |m| `elixir #{m[0]}` } | |
end |
#!/bin/bash | |
# This script can be used in "run & hope" mode or you can use it as a recipe to | |
# do things manually - you probably want the latter if you really care about | |
# the data in your databases. | |
# Happy hacking | |
# /Eoin/ | |
# Tell bash to stop if something goes wrong | |
set -e |
function isPlainObject(o) { | |
return o && toString.call(o) === '[object Object]' && 'isPrototypeOf' in o; | |
} | |
function isArray(o) { | |
return toString.call(o) == '[object Array]'; | |
} | |
function objectToString(val) { | |
var INDENT = ' '; |
mix phx.new app_name | |
cd app_name | |
cd assets | |
npm install tailwindcss @tailwindcss/ui postcss-import postcss-loader --save-dev | |
npx tailwindcss init | |
npx tailwind init tailwindcss-full.js --full | |
# Change the app dir to your app dir! |