Skip to content

Latest commit

 

History

History
43 lines (39 loc) · 1.03 KB

README.md

File metadata and controls

43 lines (39 loc) · 1.03 KB

EcoPolice-Server🏭

Server for EcoPolice app

Run

node index.js
or

npm i pm2 -g
pm2 start index.js --watch --ignore-watch 'public/*'

Methods

  • GET /all - returns all the disasters
  • GET /one/<id> - returns certaint disaster by id
  • POST /upload - uploads photos of disaster
  • POST /add - adds new disaster

Database

create table main
(
    id                  int auto_increment,
    disasterName        text   not null,
    disasterDescription text   null,
    disasterDate        bigint null,
    lat                 float  null,
    `long`              float  null,
    objectName          text   null,
    owner               text   null,
    cause               text   null,
    product             text   null,
    volume              int    null,
    area                int    null,
    damageCount         int    null,
    damagedObjects      text   null,
    images              text   null,
    constraint main_id_uindex
        unique (id)
);

alter table main
    add primary key (id);