<commit_before># ParkingLotTrackerServer
Server application for the ParkingLotTracker project.

## Table of Contents

- [Installation](#installation)
- [How to run](#how-to-run)
- [API Documentation](#api-documentation)

## Installation

```sh
$ npm install
```

Change the database settings in Config directory.
 - default is the production database.
 - dev is the development database.
 - test is for the test database.

To enable additional settings modify src/dbconnection.js
To find out which options that are available look at:
- https://github.com/mysqljs/mysql#connection-options
- https://github.com/mysqljs/mysql#pool-options

## How to run

```sh
$ npm start
```
To change which database is used change the package.json start script.

## Tests

To run tests
```sh
$ npm test
```
This script uses the test database.

## API Documentation
API Endpoint | Description
------------ | -------------
parkingLots |
/api/v0/parkinglots | GET - All parkinglots
/api/v0/parkinglots/:id | GET - Single parkinglot
/api/v0/parkinglots | POST - Creates new parkinglot
/api/v0/parkinglots | PUT - Updates a parkinglot
parkingLogs |
/api/v0/parkinglogs | GET - All parkinglogs
/api/v0/parkinglogs/:id | GET/DELETE - Single parkinglog
/api/v0/parkinglogs | POST - Creates new parkinglog
/api/v0/parkinglogs | PUT - Updates a parkinglog, only the currentParked value can be changed.
/api/v0/parkinglogs/latest | GET - Single parkinglog of latest date.<commit_msg>Fix a bug in READMEs table of content and some ambigious text<commit_after># ParkingLotTrackerServer
Server application for the ParkingLotTracker project.

## Table of Contents

- [Installation](#installation)
- [How to run](#how-to-run)
- [API Documentation](#api-documentation)
- [Tests](#tests)

## Installation

```sh
$ npm install
```

Change the database settings in Config directory.
 - default is the production database.
 - dev is the development database.
 - test is for the test database.

To enable additional settings modify src/dbconnection.js
To find out which options that are available look at:
- https://github.com/mysqljs/mysql#connection-options
- https://github.com/mysqljs/mysql#pool-options

## How to run

```sh
$ npm start
```
To change which environmental mode that is used (including database) modify the package.json start script.

## API Documentation
API Endpoint | Description
------------ | -------------
parkingLots |
/api/v0/parkinglots | GET - All parkinglots
/api/v0/parkinglots/:id | GET - Single parkinglot
/api/v0/parkinglots | POST - Creates new parkinglot
/api/v0/parkinglots | PUT - Updates a parkinglot
parkingLogs |
/api/v0/parkinglogs | GET - All parkinglogs
/api/v0/parkinglogs/:id | GET/DELETE - Single parkinglog
/api/v0/parkinglogs | POST - Creates new parkinglog
/api/v0/parkinglogs | PUT - Updates a parkinglog, only the currentParked value can be changed.
/api/v0/parkinglogs/latest | GET - Single parkinglog of latest date.

## Tests

To run tests
```sh
$ npm test
```
This script uses the test database.
{'fraction_non_alphanumeric': 0.11620185922974767, 'fraction_numerical': 0.00597609561752988, 'mean_word_length': 3.7901430842607313, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '157244', 'n_tokens_mistral': 940, 'n_tokens_neox': 908, 'n_words': 313}