Skip to content
This repository has been archived by the owner on Nov 5, 2020. It is now read-only.

Commit

Permalink
Updates Node. Updates dependencies. Adds more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
zrrrzzt committed Sep 5, 2017
1 parent eed87f1 commit 3f20ead
Show file tree
Hide file tree
Showing 7 changed files with 8,937 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Setting the base to nodejs 7.10.0
FROM node:7.10.0-alpine
# Setting the base to nodejs 8.4.0
FROM node:8.4.0-alpine

# Maintainer
MAINTAINER Geir Gåsodden
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Mocks the auth service
```bash
JWT_SECRET=Louie Louie, oh no, I got to go Louie Louie, oh no, I got to go
ENCRYPTOR_SECRET=Louie Louie, oh no, I got to go Louie Louie, oh no, I got to go
SESSION_STORAGE_URL=https://tmp.storage.micro.t-fk.no
SESSION_STORAGE_URL=https://tmp.storage.tjeneste.win
```

## API
Expand Down
2 changes: 1 addition & 1 deletion docker.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
NODE_ENV=production
JWT_SECRET=Louie Louie, oh no, I got to go Louie Louie, oh no, I got to go
ENCRYPTOR_SECRET=Louie Louie, oh no, I got to go Louie Louie, oh no, I got to go
SESSION_STORAGE_URL=https://tmp.storage.micro.t-fk.no
SESSION_STORAGE_URL=https://tmp.storage.tjeneste.win
3 changes: 3 additions & 0 deletions lib/save-session.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@
const config = require('../config')
const axios = require('axios')
const encryptor = require('simple-encryptor')(config.ENCRYPTOR_SECRET)
const logger = require('./logger')

module.exports = async data => {
const payload = {
value: encryptor.encrypt(data)
}
try {
const result = await axios.post(config.SESSION_STORAGE_URL, payload)
logger(['save-session', 'success', result.data.key])
return result.data.key
} catch (error) {
logger(['save-session', error])
throw error
}
}
Loading

0 comments on commit 3f20ead

Please sign in to comment.