Skip to content

hancedevs/attendance-app

Repository files navigation

Nest Logo

HanceCS SuperApp backend.

Description

The entire backend for the hancecs app.

Installation

$ npm install

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Guides

Uploading files

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'

Getting files

All files exist at BASE_URL/file/[filename].

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published