add server docker file
This commit is contained in:
parent
1decbb8e91
commit
c14a4726ba
@ -10,7 +10,10 @@ http {
|
||||
server {
|
||||
|
||||
location /submit {
|
||||
proxy_pass http://tradegame/submit;
|
||||
proxy_pass http://tradegame:5000/submit;
|
||||
}
|
||||
location /status {
|
||||
proxy_pass http://tradegame:5000/status;
|
||||
}
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
|
@ -1,18 +1,34 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>🚂Vote Train🚂</title>
|
||||
<title>oh ne!</title>
|
||||
<link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet">
|
||||
<script type="text/javascript" src="script.js"></script>
|
||||
</head>
|
||||
<body class="">
|
||||
<div class="justify-center text-center text-white sm:text-lg bg-green-200 sm:p-20 h-full m-36 sm:rounded-3xl">
|
||||
<div id="input" class="py-10 sm:max-w-xl mx-auto font-mono">
|
||||
<form action="javascript:void(0)" class="shadow-2xl sm:rounded-r-full sm:p-10 bg-gradient-to-t from-black to-gray-500 tracking-widest">
|
||||
<input type="text" placeholder="key" class="text-black" id="key"/><br>
|
||||
Upvote: <input type="checkbox" id="upvote"/><br>
|
||||
Downvote: <input type="checkbox" id="downvote"/><br>
|
||||
<button onclick="send()" class="bg-gray-600 ">Submit</button>
|
||||
<div class="text-center justify-center text-black sm:text-lg bg-green-200 sm:p-20 h-full m-36 sm:rounded-3xl ">
|
||||
Info <br>
|
||||
<div id="price">Price: 0</div>
|
||||
<div id="ask">Ask: 0</div>
|
||||
<div id="bid">Bid: 0</div>
|
||||
</div>
|
||||
<div class="text-center justify-center text-white sm:text-lg bg-green-200 sm:p-20 h-full m-36 sm:rounded-3xl flex">
|
||||
<div id="u1" class="p-1 font-mono">
|
||||
<form action="javascript:void(0)" class="shadow-2xl sm:rounded-l-full sm:p-10 bg-gradient-to-t from-black to-gray-500 tracking-widest w-96">
|
||||
Agne <br>
|
||||
<div id="AgneUSD">USD: 0</div>
|
||||
<div id="AgneBTC">BTC: 0</div>
|
||||
<div id="AgneMessage"></div>
|
||||
<button onclick="send('Agne','USD')" class="bg-gray-600 ">USD</button> <button onclick="send('Agne','BTC')" class="bg-gray-600">BTC</button>
|
||||
</form>
|
||||
</div>
|
||||
<div id="u1" class="p-1 font-mono">
|
||||
<form action="javascript:void(0)" class="shadow-2xl sm:rounded-r-full sm:p-10 bg-gradient-to-t from-black to-gray-500 tracking-widest w-96">
|
||||
Dan <br>
|
||||
<div id="DanUSD">USD: 0</div>
|
||||
<div id="DanBTC">BTC: 0</div>
|
||||
<div id="DanMessage"></div>
|
||||
<button onclick="send('Dan','USD')" class="bg-gray-600 ">USD</button> <button onclick="send('Dan','BTC')" class="bg-gray-600">BTC</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,9 +1,7 @@
|
||||
async function send(){
|
||||
async function send(userID, asset){
|
||||
data={
|
||||
key:document.getElementById("key").value,
|
||||
upvote: document.getElementById("upvote").checked,
|
||||
downvote:document.getElementById("downvote").checked,
|
||||
|
||||
userID: userID,
|
||||
asset: asset
|
||||
}
|
||||
let response = await fetch('/submit', {
|
||||
method: 'POST',
|
||||
|
9
server/Dockerfile
Normal file
9
server/Dockerfile
Normal file
@ -0,0 +1,9 @@
|
||||
FROM node:latest
|
||||
|
||||
ADD ./ /app
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN npm i
|
||||
|
||||
CMD ["node /app/index.js"]
|
Loading…
Reference in New Issue
Block a user