HanceCS SuperApp backend.
The entire backend for the hancecs app.
$ npm install
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
To upload files:
With JS:
const fileInput = document.querySelector('input[type="file"]'); // Assuming there's a file input in your HTML
const baseUrl = 'BASE_URL/attendance/attachment';
const token = 'TOKEN';
fileInput.addEventListener('change', () => {
const formData = new FormData();
const file = fileInput.files[0]; // Get the first selected file
formData.append('file', file);
fetch(baseUrl, {
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`
},
body: formData,
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
});
With Curl:
curl -X POST -F "file=@./confs/flake.nix" BASE_URL/attendance/attachment -H 'Authorization:Bearer TOKEN'
All files exist at BASE_URL/file/[filename]
.