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
var vary = require(‘vary’); |
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
var vary = require(‘cloud/lib/vary.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
var cors = require('cloud/lib/cors.js'); | |
app.use(cors()); | |
app.options('*', cors()); |
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
function get(req, res) { | |
var Foo, | |
query, | |
foos; | |
Foo = Parse.Object.extend("Foo", {}, {}); | |
query = new Parse.Query(Foo); | |
foos = []; |
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
function handleError (res, message) { | |
return function (error) { | |
res.json(`${message} ${JSON.stringify(error)}`); | |
} | |
}; |
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
#!/bin/bash | |
# --api: flag to create an api only rails app | |
# --skip-active-record: Removes active record support | |
# --skip-sprockets: Removes Asset compilation support http://guides.rubyonrails.org/asset_pipeline.html | |
rails new api-example --api --skip-active-record --skip-sprockets |
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
#!/bin/bash | |
rails g mongoid:config |
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
#!/bin/bash | |
# Just a healthy reminder of the most used rvm commands. | |
# Just uncomment those you might want to use | |
# change gemset | |
# rvm use ruby-version@gemset-name | |
# create and change gemset | |
# rvm use ruby-version@gemset-name --create |
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
scope '/api', defaults: {format: 'json'} do | |
scope '/v1' do | |
scope '/gorilla' do | |
get '/' => 'api/v1/gorilla#index' | |
end | |
end | |
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
module Api | |
module V1 | |
class GorillaController < ApplicationController | |
def index | |
@gorillas = Gorilla.all | |
render json: {message: 'We are not extinct. Just well hidden.'} | |
end | |
end | |
end | |
end |
OlderNewer