- Go to Digital Ocean
- Create new droplet
- London
- Ubuntu
- No apps
- Add SSH keys
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contentSecurityPolicy: { | |
'default-src': "'none'", | |
'script-src': "'self'", | |
'connect-src': "'self'", | |
'style-src': "'self' 'unsafe-inline'", | |
'font-src': "'self' 'unsafe-inline'", | |
'img-src': "'self'" | |
}, | |
// Goes between EmberENV and APP in /config/environment.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule PubSub do | |
def broadcast(channel, topic, payload) do | |
{:ok, client} = Exredis.start_link | |
payload = payload |> Map.put(:topic, topic) | |
client |> Exredis.Api.publish channel, Poison.encode!(payload) | |
end | |
def subscribe(channel, module) do | |
sup = spawn_link fn -> accept_messages(module) end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ... | |
model: function(params) { | |
// ... | |
var versions = _this.store.findRecord('post-version', post.get('id')); | |
// http://localhost:4101/api/v1/posts/1/versions gets called correctly... | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import DS from "ember-data"; | |
export default DS.RESTAdapter.extend({ | |
host: 'http://localhost:4101/api/v1', | |
buildURL: function(root, suffix, record) { | |
var url = this._super(); | |
return url + '/posts/' + suffix + '/versions'; | |
} | |
}); |