https://hub.docker.com/r/lombardi/generic-forms-api
Generic data collector for your startup idea.
curl -X 'PUT' \
'http://forms.example.com/v1/entries/' \
-H 'accept: text/plain' \
-H 'Content-Type: application/json' \
-d '{
"data": "example msg or any JSON object",
"email": "[email protected]",
"id": "project_name",
"ts": "2006-01-02T15:04:05Z"
}'
const reqBody: FormData = {
email: formData.email,
data: formData.message,
id: "my-app-name",
ts: new Date().toISOString(),
};
try {
const response = await axios.put(
"https://forms.lombardi.lab.patos.dev/v1/entries/",
reqBody
);
if (response.status === 200) {
console.log(true);
}
} catch (error) {
console.error(error);
}
This adds to the db (mongo). Note that the field data is any JS object, so customize it to your liking!
Then just:
curl -X 'GET' \
'http://forms.example.com/v1/entries/' \
-H 'accept: application/json' \
-H 'Authorization: Bearer AUTH_TOKEN'
...and get the results.
Content type
Image
Digest
sha256:c19c7ba50…
Size
19.1 MB
Last updated
over 1 year ago
docker pull lombardi/generic-forms-api