This file contains hidden or 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
replica_sets = mm_env['replica_sets'] # node1:port&node2:port | |
rs_list = replica_sets.split("&").map {|rs| host,port = rs.split(":"); [host,port.to_i] } | |
MongoMapper.connection = Mongo::RetryReplicaSetConnection.new(*(rs_list << {:read_secondary => true, :auto_refresh => true })) | |
MongoMapper.database = mm_env['database'] | |
MongoMapper.database.authenticate(mm_env['username'], mm_env['password']) | |
This file contains hidden or 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
<h3>Hours Worked</h3> | |
<% user_signed_in? %> | |
<table> | |
<table class="table table-striped table-bordered table-condensed table-hover"> | |
<thead> | |
<thead> | |
<tr> | |
<th>Date</th> | |
<th>Hours Worked</th> | |
<th>Start</th> |
This file contains hidden or 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 proxy from "@fly/proxy" | |
import { forceSSL } from './lib/utilities' | |
const origin = proxy("https://viaglamour.com/") | |
/** | |
* Rewrite the path to /store/<hostname> | |
*/ | |
function rewriteRequest(req) { | |
const url = new URL(req.url) | |
let path = "/store/" + url.hostname.replace(/\.[a-z]+/, '') |