xxxxxxxxxx
const fd = new FormData();
fd.append("email", data.username);
fd.append("password", data.password);
xxxxxxxxxx
const handleSubmit = async (e) => {
e.preventDefault();
const { userName, firstName, lastName, wallet_address, email, password } =
data;
try {
let fd = new FormData();
fd.append("userName", userName);
fd.append("firstName", firstName);
fd.append("lastName", lastName);
fd.append("wallet_address", wallet_address);
fd.append("email", email);
fd.append("password", password);
const res = await getSignUp(fd);
console.log(res);
window.alert(`${res.data.message}`);
} catch (err) {
window.alert(`${err}`);
navigate("/signin");
}
};
xxxxxxxxxx
const form = document.getElementById("form");
const submitter = document.querySelector("button[value=save]");
const formData = new FormData(form, submitter);
const output = document.getElementById("output");
for (const [key, value] of formData) {
output.textContent += `${key}: ${value}\n`;
}
xxxxxxxxxx
<form id="form">
<input type="text" name="text1" value="foo" />
<input type="text" name="text2" value="bar" />
<input type="text" name="text2" value="baz" />
<input type="checkbox" name="check" checked disabled />
<button name="intent" value="save">Save</button>
<button name="intent" value="saveAsCopy">Save As Copy</button>
</form>
<output id="output"></output>
xxxxxxxxxx
#!/bin/bash
SECRET_FILE=/tmp/mounted_secret
if test -f "$SECRET_FILE";then
## Silence any outputs this command might give
## Otherwise the secret value might get exposed in the container logs
export DB_URI=$(cat $SECRET_FILE) &>/dev/null
fi
/path/app "$@"
xxxxxxxxxx
#!/usr/bin/env bash
set -e
if [ "$1" = 'postgres' ]; then
chown -R postgres "$PGDATA"
if [ -z "$(ls -A "$PGDATA")" ]; then
gosu postgres initdb
fi
exec gosu postgres "$@"
fi
exec "$@"
xxxxxxxxxx
#!/usr/bin/env bash
set -e
if [ "$1" = 'postgres' ]; then
chown -R postgres "$PGDATA"
if [ -z "$(ls -A "$PGDATA")" ]; then
gosu postgres initdb
fi
exec gosu postgres "$@"
fi
exec "$@"