https://metanit.com/web/nodejs/
FROM node:16
WORKDIR /usr/src/app
COPY ./package*.json ./
COPY ./lerna.json ./
RUN npm install
WORKDIR /usr/src/app/packages/backend
COPY ./packages/backend ./
RUN npm install
WORKDIR /usr/src/app/packages/frontend
COPY ./packages/frontend ./
RUN npm install --legacy-peer-deps
WORKDIR /usr/src/app/packages/static_hoster
COPY ./packages/static_hoster ./
RUN npm install
WORKDIR /usr/src/app
RUN npm run build
COPY . .
EXPOSE 3000
CMD ["npm", "start"]
<form action="/send_file" method="post" enctype="multipart/form-data" class="upload_form" id="file-upload">
<input type="file" name="avatar" id="file" multiple>
<button class="begin_uploading_button">Загрузить файлы</button>
<label for="file" class="upload_label">Выбрать файл</label>
<input type='text' name='some_data' value='some value' style='display: none'>
<input type="submit" name="submit" value="Загрузить" class="submit_button">
</form>
function userWin(val) {
return new Promise(function (resolve, reject) {
const par = [val.gold,val.xp,val.user];
const win = `UPDATE user SET monets = ${par[0]},exp = ${par[1]} WHERE uid = ${par[2]}`;
connection.query(win, (err, results) => {
if (err) reject(err);
resolve(results);
});
connection.end();
}).then(r => {
console.log(r)
})
}
function userWin(val) {
return new Promise(function (resolve, reject) {
const par = [val.gold,val.xp,val.user];
let monets = par[0],
exp = par[1];
const win = `UPDATE user SET ? WHERE uid = ${par[2]}`;
connection.query(win, {monets,exp}, (err, results) => {
if (err) reject(err);
resolve(results);
});
connection.end();
}).then(r => {
console.log(r)
})
}