app/API build adjustments; get user from ctx

This commit is contained in:
Daniel J. Summers 2018-03-12 23:14:16 -05:00
parent b7406bd827
commit 8d84bdb2e6
4 changed files with 9 additions and 6 deletions

4
.gitignore vendored
View File

@ -254,8 +254,8 @@ paket-files/
# Compiled files / application
src/api/build
src/api/public/index.html
src/api/public/static
src/public/index.html
src/public/static
src/config.json
/build
src/*.exe

View File

@ -33,7 +33,8 @@ func sendJSON(w http.ResponseWriter, r *http.Request, result interface{}) {
/* Handlers */
func journal(w http.ResponseWriter, r *http.Request, _ httprouter.Params, db *sql.DB) {
reqs := data.Journal(db, "TODO: get user ID")
user := r.Context().Value(ContextUserKey)
reqs := data.Journal(db, user.(string))
if reqs == nil {
reqs = []data.JournalRequest{}
}

View File

@ -4,8 +4,8 @@ var path = require('path')
module.exports = {
build: {
env: require('./prod.env'),
index: path.resolve(__dirname, '../../api/public/index.html'),
assetsRoot: path.resolve(__dirname, '../../api/public'),
index: path.resolve(__dirname, '../../public/index.html'),
assetsRoot: path.resolve(__dirname, '../../public'),
assetsSubDirectory: 'static',
assetsPublicPath: '/',
productionSourceMap: true,

View File

@ -11,7 +11,9 @@
"unit": "cross-env BABEL_ENV=test karma start test/unit/karma.conf.js --single-run",
"e2e": "node test/e2e/runner.js",
"test": "npm run unit && npm run e2e",
"lint": "eslint --ext .js,.vue src test/unit/specs test/e2e/specs"
"lint": "eslint --ext .js,.vue src test/unit/specs test/e2e/specs",
"apistart": "cd .. && go build -o mpj-api.exe && mpj-api.exe",
"vue": "node build/build.js prod && go build -o mpj-api.exe && mpj-api.exe"
},
"dependencies": {
"auth0-js": "^9.3.3",