This repository has been archived by the owner on Dec 6, 2024. It is now read-only.
forked from andreclaudino/virtual-wallet-simulator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.html
65 lines (60 loc) · 2.94 KB
/
server.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>server.py</title>
<link rel="stylesheet" href="../pycco.css">
</head>
<body>
<div id='container'>
<div id="background"></div>
<div class='section'>
<div class='docs'><h1>server.py</h1></div>
</div>
<div class='clearall'>
<div class='section' id='section-0'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-0'>#</a>
</div>
</div>
<div class='code'>
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">base.connect_db</span> <span class="kn">import</span> <span class="n">ConnectDB</span>
<span class="kn">from</span> <span class="nn">utils.application_factory</span> <span class="kn">import</span> <span class="n">create_app</span>
<span class="kn">from</span> <span class="nn">utils.authorize</span> <span class="kn">import</span> <span class="n">server_config</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-1'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-1'>#</a>
</div>
<h3><span id="script-to-launch-server" href="script-to-launch-server"> Script to launch server </span></h3>
</div>
<div class='code'>
<div class="highlight"><pre></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-2'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-2'>#</a>
</div>
<p>This script launches payment-system server from configurations
using configurations returned by server_config().</p>
<p>It neeed certification files <strong>cert.pem</strong> and <strong>key.pem</strong> in launch directory</p>
</div>
<div class='code'>
<div class="highlight"><pre><span class="k">if</span> <span class="vm">__name__</span> <span class="o">==</span> <span class="s2">"__main__"</span><span class="p">:</span>
<span class="n">run_config</span> <span class="o">=</span> <span class="n">server_config</span><span class="p">()[</span><span class="s1">'run_config'</span><span class="p">]</span>
<span class="n">app</span> <span class="o">=</span> <span class="n">create_app</span><span class="p">()</span>
<span class="n">ConnectDB</span><span class="o">.</span><span class="n">connect_database</span><span class="p">()</span>
<span class="n">app</span><span class="o">.</span><span class="n">run</span><span class="p">(</span><span class="n">ssl_context</span><span class="o">=</span><span class="p">(</span><span class="s1">'cert.pem'</span><span class="p">,</span> <span class="s1">'key.pem'</span><span class="p">),</span> <span class="o">**</span><span class="n">run_config</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class='clearall'></div>
</div>
</body>