Skip to content

Commit 23733e1

Browse files
committed
added 'helmet', changed readme
1 parent 0ce07c7 commit 23733e1

File tree

8 files changed

+38
-4
lines changed

8 files changed

+38
-4
lines changed

.DS_Store

-6 KB
Binary file not shown.

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
/build
33
.env
44
dump.rdb
5-
/coverage
5+
/coverage
6+
**/.DS_Store

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,18 @@ To run all testsheets enter:
4848
npm test
4949
```
5050

51+
## **`Postman` e2e tests**
52+
53+
+ App covered with e2e tests
54+
+ `100%` coverage, over 280 tests
55+
56+
You can find testsheets in `tests/e2e/api_v1.postman_collection.json`
57+
5158
## **`pgAdmin` panel**
5259

5360
1. Go to the `http://localhost:5050`
5461
2. Log in with email: `[email protected]` and password: `password`
55-
3. Run
62+
3. Run
5663
```
5764
docker ps -a
5865
```

package-lock.json

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"author": "",
1111
"license": "ISC",
1212
"dependencies": {
13+
"@fastify/helmet": "^13.0.0",
1314
"@fastify/swagger": "^8.15.0",
1415
"@fastify/swagger-ui": "^4.0.1",
1516
"@mgcrea/fastify-request-logger": "^1.5.0",

source/.DS_Store

-6 KB
Binary file not shown.

source/api/v1/services/.DS_Store

-6 KB
Binary file not shown.

source/main.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { initSwaggerViewer } from './api/v1/openapi/swagger/InitSwagger'
1717
import { connectAndGetRedisInstance } from './api/v1/cache/InitRedisInstance'
1818
import Healthcheck from './api/v1/shared/utils/common/Healthcheck'
1919
import { CommonHandler } from './api/v1/handlers/CommonHandler'
20+
import helmet from '@fastify/helmet'
2021

2122
const main = async () => {
2223
CONFIG.log()
@@ -28,6 +29,8 @@ const main = async () => {
2829
}
2930
})
3031

32+
server.register(helmet)
33+
3134
await initSwaggerViewer(server)
3235

3336
server.addHook('onRequest', logRequestMetadata)
@@ -40,11 +43,10 @@ const main = async () => {
4043
CONFIG.databasePassword,
4144
CONFIG.databaseName
4245
)
43-
appDataSource.isInitialized
4446
const redis = await connectAndGetRedisInstance(
4547
CONFIG.redisConnectionString
4648
)
47-
redis.PING()
49+
4850
// services DI
4951
const usersService = new UsersService(
5052
appDataSource.getRepository(UserEntity.User)

0 commit comments

Comments
 (0)