Skip to content

Commit

Permalink
Rename static resources to twofishes-static to prevent internal routi…
Browse files Browse the repository at this point in the history
…ng conflicts

(sapling split of efc0f8da738a2042240384bf61baac5ec30a84a5)
  • Loading branch information
rahulpratapm authored and mateor committed Jul 18, 2016
1 parent 876b7fb commit e286f9a
Show file tree
Hide file tree
Showing 46 changed files with 30 additions and 29 deletions.
2 changes: 1 addition & 1 deletion src/jvm/io/fsq/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ pom_target(
'src/jvm/io/fsq/twofishes/indexer/util',
'src/jvm/io/fsq/twofishes/replayer',
'src/jvm/io/fsq/twofishes/server',
'src/jvm/io/fsq/twofishes/server/resources/static',
'src/jvm/io/fsq/twofishes/server/resources/twofishes-static',
'src/jvm/io/fsq/twofishes/server/resources/warmup',
'src/jvm/io/fsq/twofishes/util',
'src/jvm/io/fsq/twofishes/util/data',
Expand Down
2 changes: 1 addition & 1 deletion src/jvm/io/fsq/twofishes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Data import
Serving
=======
* ./src/jvm/io/fsq/twofishes/scripts/serve.py -p 8080 /output/dir – Where /output/dir will contain a subdirectory whose name will be the date of the most recent build, for example `2013-02-25-01-08-23.803740`. You need to point to this subdirectory or to a folder called `latest` which is created during the build process (in the twofishes directory) and is a symlink to the most recent dated subdirectory.
* server should be responding to finagle-thrift on the port specified (8080 by default), and responding to http requests at the next port up: <http://localhost:8081/?query=rego+park+ny> <http://localhost:8081/static/geocoder.html#rego+park>
* server should be responding to finagle-thrift on the port specified (8080 by default), and responding to http requests at the next port up: <http://localhost:8081/?query=rego+park+ny> <http://localhost:8081/twofishes-static/geocoder.html#rego+park>
* use the --host flag to specify a bind address (defaults to 0.0.0.0)
* to enable hotfixes and allow refreshing, use the --hotfix\_basepath and --enable\_private\_endpoints params as detailed under [Hotfixes](#hotfixes) below

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ If you put a geojson (or shapefile) in data/private/polygons, along with a .mapp
```sh
./src/jvm/io/fsq/twofishes/scripts/serve.py output/
```
- View it! http://localhost:8081/static/geocoder.html
- View it! http://localhost:8081/twofishes-static/geocoder.html


2 changes: 1 addition & 1 deletion src/jvm/io/fsq/twofishes/docs/twofishes_requests.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Almost every parameter in [GeocodeRequest](https://github.com/foursquare/fsqio/b

The combined json interface allows you to construct queries out of these parameters like <http://demo.twofishes.net/?query=new%20york&lang=es&maxInterpretations=4>

These queries also work as parameters to the debug interface either after the ? or the # as seen at <http://demo.twofishes.net/static/geocoder.html#query=new%20york&lang=es&maxInterpretations=4> or <http://demo.twofishes.net/static/geocoder.html?query=new%20york&lang=es&maxInterpretations=4>
These queries also work as parameters to the debug interface either after the ? or the # as seen at <http://demo.twofishes.net/twofishes-static/geocoder.html#query=new%20york&lang=es&maxInterpretations=4> or <http://demo.twofishes.net/twofishes-static/geocoder.html?query=new%20york&lang=es&maxInterpretations=4>

- query=[geocode query] -- For geocoding. The server will attempt to geocode as much of the string (from left to right) as possible
- ll=[lat,lng] -- latlng as comma separated double ie, 40.74,-74.0
Expand Down
4 changes: 2 additions & 2 deletions src/jvm/io/fsq/twofishes/scripts/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ def evallog(title, old = None, new = None):
'</ul>')
else:
message = ('%s: <b>%s</b><ul>' % (query, title) +
'<li><a href="%s">OLD</a>%s' % (options.serverOld + '/static/geocoder.html#' + param_str, oldMessage) +
'<li><a href="%s">NEW</a>%s' % (options.serverNew + '/static/geocoder.html#' + param_str, newMessage) +
'<li><a href="%s">OLD</a>%s' % (options.serverOld + '/twofishes-static/geocoder.html#' + param_str, oldMessage) +
'<li><a href="%s">NEW</a>%s' % (options.serverNew + '/twofishes-static/geocoder.html#' + param_str, newMessage) +
'</ul>')

for i in xrange(0, lineCount):
Expand Down
2 changes: 1 addition & 1 deletion src/jvm/io/fsq/twofishes/scripts/update-js-thrift.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

thrift --gen js -o server/src/main/resources/static/ interface/src/main/thrift/geocoder.thrift
thrift --gen js -o server/src/main/resources/twofishes-static/ interface/src/main/thrift/geocoder.thrift
2 changes: 1 addition & 1 deletion src/jvm/io/fsq/twofishes/server/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ scala_library(
'src/jvm/io/fsq/twofishes/core',
'src/jvm/io/fsq/twofishes/country',
'src/jvm/io/fsq/twofishes/hacks',
'src/jvm/io/fsq/twofishes/server/resources/static',
'src/jvm/io/fsq/twofishes/server/resources/twofishes-static',
'src/jvm/io/fsq/twofishes/server/resources/warmup',
'src/jvm/io/fsq/twofishes/util',
'src/thrift/io/fsq/twofishes',
Expand Down
4 changes: 2 additions & 2 deletions src/jvm/io/fsq/twofishes/server/GeocodeServer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ class GeocoderHttpService(geocoder: Geocoder.ServiceIface) extends Service[HttpR
thriftRequest
}

if (path.startsWith("/static/")) {
if (path.startsWith("/twofishes-static/")) {
val dataRead = {
inputStreamToByteArray(getClass.getResourceAsStream("/io/fsq/twofishes/server/resources" + path))
}
Expand Down Expand Up @@ -495,7 +495,7 @@ class GeocoderHttpService(geocoder: Geocoder.ServiceIface) extends Service[HttpR
}
} else {
val response = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.NOT_FOUND)
val msg = new BufferedSource(getClass.getResourceAsStream("/io/fsq/twofishes/server/resources/static/index.html")).getLines.mkString("\n")
val msg = new BufferedSource(getClass.getResourceAsStream("/io/fsq/twofishes/server/resources/twofishes-static/index.html")).getLines.mkString("\n")
response.setContent(ChannelBuffers.copiedBuffer(msg, CharsetUtil.UTF_8))
response.headers.add("Content-Length", response.getContent.readableBytes.toString)
Future.value(response)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright 2015 Foursquare Labs Inc. All Rights Reserved.

resources(
name = 'static',
name = 'twofishes-static',
# TODO: Don't rglobs.
sources = rglobs('*'),
)
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ a:visited {color:#460;text-decoration:none;}
#controls .text {margin:90px 0 0;}
#controls a:hover,
#controls a:active {text-decoration:underline;}
#forkme {width:141px;height:141px;z-index:9999;position:absolute;left:0;top:0;background:transparent url(/static/ForkMe_Blk.png) no-repeat left top;}
#forkme {width:141px;height:141px;z-index:9999;position:absolute;left:0;top:0;background:transparent url(/twofishes-static/ForkMe_Blk.png) no-repeat left top;}
#form {margin:10px 0 0;font-size:14px;color:#666;font-family:CabinItalic,sans-serif;}
#form #wkt {width:100%;height:150px;border:1px solid #999;padding:3px;resize:none;}
#form #urlify {vertical-align:baseline;margin:10px 5px 0 0;}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<html>
<head>
<link rel="stylesheet" type="text/css" href="/static/font/Cabin.css" />
<link rel="stylesheet" type="text/css" href="/twofishes-static/font/Cabin.css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- Conditional commenting for non-IE browsers -->
<!--[if !IE]><!-->
<link rel="stylesheet" type="text/css" href="/static/wicket/doc/index.css" />
<link rel="stylesheet" type="text/css" href="/twofishes-static/wicket/doc/index.css" />
<!--<![endif]-->
<!-- Conditional commenting for IE 6.x -->
<!--[if IE]>
Expand All @@ -18,8 +18,8 @@
<title>Wicket - Lightweight Javascript for WKT [Sandbox]</title>
<!--<script src="../lib/leaflet.js"></script>-->
<script src="http://maps.google.com/maps/api/js?sensor=false&libraries=drawing" type="text/javascript"></script>
<script src="/static/wicket/wicket.js" type="text/javascript"></script>
<script src="/static/wicket/wicket-gmap3.js" type="text/javascript"></script>
<script src="/twofishes-static/wicket/wicket.js" type="text/javascript"></script>
<script src="/twofishes-static/wicket/wicket-gmap3.js" type="text/javascript"></script>
<script type="text/javascript">
var app = (function () {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ a:visited {color:#460;text-decoration:none;}
#controls .text {margin:90px 0 0;}
#controls a:hover,
#controls a:active {text-decoration:underline;}
#forkme {width:141px;height:141px;z-index:9999;position:absolute;left:0;top:0;background:transparent url(/static/ForkMe_Blk.png) no-repeat left top;}
#forkme {width:141px;height:141px;z-index:9999;position:absolute;left:0;top:0;background:transparent url(/twofishes-static/ForkMe_Blk.png) no-repeat left top;}
#form {margin:10px 0 0;font-size:14px;color:#666;font-family:CabinItalic,sans-serif;}
#form #wkt {width:100%;height:150px;border:1px solid #999;padding:3px;resize:none;}
#form #urlify {vertical-align:baseline;margin:10px 5px 0 0;}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@

var myIcon = L.icon({
iconAnchor: [8, 8],
iconUrl: '/static/leaflet/images/red_dot.png',
iconUrl: '/twofishes-static/leaflet/images/red_dot.png',
});

var boundingBox = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
<![endif]-->
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
<script src="TileLayer.Common.js"></script>
<script src="/static/Wicket/wicket.js"></script>
<script src="/static/Wicket/wicket-leaflet.js"></script>
<script src="/static/gen-js/geocoder_types.js"></script>
<script src="/twofishes-static/Wicket/wicket.js"></script>
<script src="/twofishes-static/Wicket/wicket-leaflet.js"></script>
<script src="/twofishes-static/gen-js/geocoder_types.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script>
<style>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ function success(data, bulkInputs) {

function linkifySlugs(str, group1, group2) {
var id = group1 + ':' + group2;
return '<a href="/static/geocoder.html#slug=' + id + '">' + id + '</a>';
return '<a href="/twofishes-static/geocoder.html#slug=' + id + '">' + id + '</a>';
}

_(data.debugLines).each(function(l) {
Expand Down Expand Up @@ -353,7 +353,7 @@ function success(data, bulkInputs) {

var myIcon = L.icon({
iconAnchor: [8, 8],
iconUrl: '/static/leaflet/images/red_dot.png',
iconUrl: '/twofishes-static/leaflet/images/red_dot.png',
});

if (data.requestWktGeometry) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
}

.foursquarelogo {
height: 21px;
height: 30px;
vertical-align: middle;
}

ul {
Expand All @@ -60,14 +61,14 @@ <h1 class="header">
</h1>

<div class="logo">
<img src="/static/twofishes2.png"/>
<img src="/twofishes-static/twofishes2.png"/>
</div>

<h2>HTTP Interfaces</h2>

<ul class="gettingStarted">
<li> Debug interfaces for <a href="/static/autocomplete.html">autocomplete</a> and
<a href="/static/geocoder.html">forward & reverse geocoding</a>
<li> Debug interfaces for <a href="/twofishes-static/autocomplete.html">autocomplete</a> and
<a href="/twofishes-static/geocoder.html">forward & reverse geocoding</a>

<li>REST-y GET interface at "/" like <a href="/?query=nyc">/?query=nyc</a> or <a href="/?ll=40.74,-74.0">/?ll=40.74,-74.0</a>.
<li>Thrift-json GET/POST interfaces at /geocode, /reverseGeocode, /bulkReverseGeocode and /bulkSlugLookup that take
Expand All @@ -78,7 +79,7 @@ <h2>HTTP Interfaces</h2>

<h2>Documentation</h2>
<ul>
<a href="https://github.com/foursquare/twofishes/blob/master/docs/twofishes_requests.md">Twofish request documentation</a>
<a href="https://github.com/foursquare/twofishes/blob/master/docs/twofishes_requests.md">Twofishes request documentation</a>
</ul>

<h2>Acknowledgements</h2>
Expand All @@ -90,7 +91,7 @@ <h2>Acknowledgements</h2>
</ul>

<div class="footer">
Developed and maintained by <a href="http://foursquare.com"><img class="foursquarelogo" src="https://playfoursquare.s3.amazonaws.com/press/logo/foursquare-logo.png"/></a>.
Developed and maintained by<a href="http://foursquare.com"><img class="foursquarelogo" src="https://playfoursquare.s3.amazonaws.com/press/2014/foursquare-wordmark.png"/></a>
</div>
</div>
</body>
Expand Down

0 comments on commit e286f9a

Please sign in to comment.