Skip to content
Open

Api #403

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions API/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# API configuration
API_PORT=4000
API_PREFIX=/api/v2


# Database ORM configuration
TYPEORM_CONNECTION=mongodb
TYPEORM_HOST=localhost
TYPEORM_PORT=27017
TYPEORM_USERNAME=projectlockdown
TYPEORM_PASSWORD=password
TYPEORM_DATABASE=projectlockdown
TYPEORM_SYNCHRONIZE=false

# TypeORM internals
TYPEORM_ENTITIES=src/**/*.entity.ts,dist/**/*.entity.js
TYPEORM_MIGRATIONS_DIR=src/migrations
TYPEORM_MIGRATIONS=src/migrations/*.ts
1 change: 1 addition & 0 deletions API/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir: __dirname,
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin'],
Expand Down
29 changes: 29 additions & 0 deletions API/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,35 @@ The following diagram showcases the general design of the API module:
[WIP]

<a href="#top">Back to top</a>
## Running the app locally

To get the MAP running locally, you will need to have
[Node.js](https://nodejs.org/en/) installed.

Clone the repository.

`git clone https://github.com/TheIOFoundation/ProjectLockdown.git`

Navigate to the MAP folder.

`cd ProjectLockdown`

`cd API`

Install the required dependencies.

`npm install`

Create a `.env` file from the template `.env.example` file.

Run the app in development mode.

`npm start`




Runs the app in the development mode on Open http://localhost:4000/api/v2/ to view it in your browser.

# Accessing the module
To access the API, please visit
Expand Down
12 changes: 0 additions & 12 deletions API/Reference/.sample-env

This file was deleted.

2 changes: 2 additions & 0 deletions API/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require('ts-node/register');
require('./src/server');
22 changes: 22 additions & 0 deletions API/jest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"json"
],
"transform": {
"^.+\\.tsx?$": "ts-jest"
},
"testRegex": "/src/.*\\.(test|spec).(ts|tsx|js)$",
"collectCoverageFrom": [
"src/**/*.{js,jsx,tsx,ts}",
"!**/node_modules/**",
"!**/vendor/**"
],
"coverageReporters": [
"json",
"lcov"
],
"testURL": "http://localhost"
}
Loading