Fix token db path

This commit is contained in:
IamTheFij 2018-02-06 10:59:19 -08:00
parent 03ceca1620
commit 3e882e862e
3 changed files with 7 additions and 3 deletions

View File

@ -3,7 +3,7 @@ services:
main:
build: .
environment:
SQLALCHEMY_DATABASE_URI: sqlite:///tokens.db
SQLALCHEMY_DATABASE_URI: sqlite:////usr/src/app/tokens.db
volumes:
- .:/usr/src/app
ports:

View File

@ -10,8 +10,8 @@ import flask
app = flask.Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = os.environ.get(
'DATABASE_URI',
'sqlite:///tokens.db'
'SQLALCHEMY_DATABASE_URI',
'sqlite:///../tokens.db'
)
app.config['SQLALCHEMY_ECHO'] = True
app.config['DEBUG'] = True

View File

@ -8,6 +8,10 @@ set :port, 3000
def get_tracking_url(tracker)
tracking_urls = {
:ups => 'https://wwwapps.ups.com/WebTracking/track?track=yes&trackNums=%s',
:dhl => 'http://www.dhl.com/en/express/tracking.html?brand=DHL&AWB=%s',
:fedex => 'https://www.fedex.com/apps/fedextrack/?tracknumbers=%s',
:ontrac => 'http://www.ontrac.com/trackingres.asp?tracking_number=%s',
:usps => 'https://m.usps.com/m/TrackConfirmAction_detail?tLabels=%s',
}
tracking_url = tracking_urls[tracker.courier_code]
if tracking_url != nil