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 # Compiled files / application
src/api/build src/api/build
src/api/public/index.html src/public/index.html
src/api/public/static src/public/static
src/config.json src/config.json
/build /build
src/*.exe src/*.exe

View File

@ -33,7 +33,8 @@ func sendJSON(w http.ResponseWriter, r *http.Request, result interface{}) {
/* Handlers */ /* Handlers */
func journal(w http.ResponseWriter, r *http.Request, _ httprouter.Params, db *sql.DB) { 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 { if reqs == nil {
reqs = []data.JournalRequest{} reqs = []data.JournalRequest{}
} }

View File

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

View File

@ -11,7 +11,9 @@
"unit": "cross-env BABEL_ENV=test karma start test/unit/karma.conf.js --single-run", "unit": "cross-env BABEL_ENV=test karma start test/unit/karma.conf.js --single-run",
"e2e": "node test/e2e/runner.js", "e2e": "node test/e2e/runner.js",
"test": "npm run unit && npm run e2e", "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": { "dependencies": {
"auth0-js": "^9.3.3", "auth0-js": "^9.3.3",