I've been following this blog post on how to set up an api-only Rails 5 application. One of the sections talks about creating a subdomain for your api
Rails.application.routes.draw do
constraints subdomain: "api" do
scope module: "api" do
/* http://meyerweb.com/eric/tools/css/reset/ | |
v2.0 | 20110126 | |
License: none (public domain) */ | |
html, body, div, span, applet, object, iframe, | |
h1, h2, h3, h4, h5, h6, p, blockquote, pre, | |
a, abbr, acronym, address, big, cite, code, | |
del, dfn, em, img, ins, kbd, q, s, samp, | |
small, strike, strong, sub, sup, tt, var, | |
b, u, i, center, |
I've been following this blog post on how to set up an api-only Rails 5 application. One of the sections talks about creating a subdomain for your api
Rails.application.routes.draw do
constraints subdomain: "api" do
scope module: "api" do
require 'rails_helper' | |
RSpec.describe TodosController, :type => :controller do | |
describe "GET #index" do | |
#describe "POST #create" do | |
#describe "GET #show" do | |
#describe "PATCH #update" do (or PUT #update) | |
#describe "DELETE #destroy" do | |
#describe "GET #new" do |
// layout file | |
<body> | |
<div class="container"> | |
<%= flash_messages %> | |
<%= yield %> | |
</div><!-- /container --> | |
</body> |
How to create the topojson map:
curl -o estados.zip http://mapserver.inegi.org.mx/MGN/mge2010v5_0.zip
curl -o municipios.zip http://mapserver.inegi.org.mx/MGN/mgm2010v5_0.zip
unzip estados.zip
unzip municipios.zip
ogr2ogr states.shp Entidades_2010_5.shp -t_srs "+proj=longlat +ellps=WGS84 +no_defs +towgs84=0,0,0"
ogr2ogr municipalities.shp Municipios_2010_5.shp -t_srs "+proj=longlat +ellps=WGS84 +no_defs +towgs84=0,0,0"
topojson -o mx_tj.json -s 1e-7 -q 1e5 states.shp municipalities.shp -p state_code=+CVE_ENT,state_name=NOM_ENT,mun_code=+CVE_MUN,mun_name=NOM_MUN
/* http://meyerweb.com/eric/tools/css/reset/ | |
v2.0 | 20110126 | |
License: none (public domain) */ | |
html, body, div, span, applet, object, iframe, | |
h1, h2, h3, h4, h5, h6, p, blockquote, pre, | |
a, abbr, acronym, address, big, cite, code, | |
del, dfn, em, img, ins, kbd, q, s, samp, | |
small, strike, strong, sub, sup, tt, var, | |
b, u, i, center, |