Skip to content

Commit

Permalink
fix: https
Browse files Browse the repository at this point in the history
  • Loading branch information
ngduc committed Nov 5, 2020
1 parent 2374b11 commit 9d11d4e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ yarn
```
- Update `package.json` and `.env` file with your information.
- Run `yarn dev`, it will create a new Mongo DB "node-rem"
- Verify: use Postman to POST https://localhost:3009/v1/auth/register to create a new user. (set payload to have email, password)
- Verify `yarn test` can run all unit tests.
- Verify: use Postman to POST https://localhost:3009/v1/auth/register to create a new user. (set payload to have email, password)
```
curl -k -d '{"email":"[email protected]", "password":"testpsw"}' -H "Content-Type: application/json" -X POST https://localhost:3009/v1/auth/register
```

### 🔧 Commands

Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ mstime.start('app-start');
Promise = require('bluebird'); // eslint-disable-line no-global-assign
const { port, env, socketEnabled } = require('./config/vars');

// const https = require('https');
const spdy = require('spdy'); // for HTTP2
const https = require('https');
// const https = require('spdy'); // for HTTP2
const fs = require('fs');
const app = require('./config/express');
const socket = require('api/services/socket');
Expand All @@ -23,7 +23,7 @@ const options = {
key: fs.readFileSync('./src/config/https/localhost-key.pem'),
cert: fs.readFileSync('./src/config/https/localhost.pem')
};
const server = spdy.createServer(options, app);
const server = https.createServer(options, app);

if (socketEnabled) {
socket.setup(server);
Expand Down

0 comments on commit 9d11d4e

Please sign in to comment.