Commit 3e857a1a authored by w2v1's avatar w2v1
Browse files

example webserver is working

parent 8c1f0ab2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ logger = create_logger()

logger.info("Test log.")


class WebDatabase(Database, PostgresMixin):
    def __init__(self, **kwargs):
        super().__init__()
+40 −0
Original line number Diff line number Diff line
import os
import sys
import psycopg2
import requests
import redis


from flask import Blueprint
from flask import render_template

from api.database.database import WebDatabase

from common.env import check_environment as ce
from common.logz import create_logger

logger = create_logger()

blueprint = Blueprint('api', __name__)


@blueprint.route('')
def health_check():
    # if os.getenv('FLASK_ENV') == 'development':
    #     return redirect('http://localhost:8030')
    # return render_template('index.html')
    return "Healthcheck"

@blueprint.route("/home")
def home():
    return "Welcome to API home"

@blueprint.route("/template")
def template():
    return render_template('sample_page.html')

@blueprint.route("db_test")
def db_test():
    with WebDatabase() as db:
        geo = db.get_test_data()
        print(geo)
+5 −3
Original line number Diff line number Diff line
FROM crunchydata/crunchy-postgres-gis:centos8-13.4-3.1-4.7.2

USER root
COPY schema /tmp/schema
COPY static /tmp/static

COPY schema/users.sql /tmp/schema
RUN cp /opt/crunchy/bin/postgres/setup.sql /pgconf/setup.sql
RUN chown postgres:postgres /pgconf/setup.sql
RUN cat /tmp/schema/users.sql >> /pgconf/setup.sql
USER postgres
 No newline at end of file
+0 −26

File deleted.

Preview size limit exceeded, changes collapsed.

+0 −0

Empty file deleted.

Loading