Index: src/mapservice/codegen/templates/__main__.mustache
===================================================================
--- src/mapservice/codegen/templates/__main__.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/codegen/templates/__main__.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,38 @@
+{{#supportPython2}}
+#!/usr/bin/env python
+{{/supportPython2}}
+{{^supportPython2}}
+#!/usr/bin/env python3
+{{/supportPython2}}
+
+import connexion
+from flask_cors import CORS
+from flask import render_template
+
+from {{packageName}} import encoder
+
+from {{packageName}}.server_impl.database.Model import db, User, ApiKey, db_test_setup
+
+app = connexion.App(__name__, specification_dir='./openapi/')
+application = app.app
+CORS(application)
+
+@application.before_first_request
+def create_database():
+	db_test_setup()
+
+@application.route("/mapservice/")
+def index():
+	return render_template('index.html')
+	
+def main():
+	application.json_encoder = encoder.JSONEncoder
+	app.add_api('openapi.yaml', arguments={'title': '{{appName}}'}, validate_responses=True)
+	application.config.from_object('{{packageName}}.server_impl.Config.DevelopmentConfig')
+
+	db.init_app(application)
+
+	app.run(port={{serverPort}})
+
+if __name__ == '__main__':
+	main()
