Skip to content

Commit

Permalink
Merge pull request #8 from ostyn/updatingAureliaWebpack
Browse files Browse the repository at this point in the history
Updating aurelia and webpack
  • Loading branch information
ostyn committed May 25, 2020
2 parents 7c9d8c6 + 924e217 commit 474d021
Show file tree
Hide file tree
Showing 79 changed files with 17,584 additions and 1,347 deletions.
2 changes: 0 additions & 2 deletions backend/backend.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import pymongo
import blogPostModule
import oneDriveModule
import vrtModule
import subscriptionModule
import userModule
import genericModule
Expand Down Expand Up @@ -67,7 +66,6 @@ def makeActivity(jsonData):

app.register_blueprint(blogPostModule.construct_blueprint(postsCollection, emailsCollection, mail))
app.register_blueprint(oneDriveModule.construct_blueprint())
app.register_blueprint(vrtModule.construct_blueprint())
app.register_blueprint(subscriptionModule.construct_blueprint(emailsCollection, mail))
app.register_blueprint(userModule.construct_blueprint(usersCollection, authModule))
app.register_blueprint(entryStatsModule.construct_blueprint(entriesCollection, entrySortOrder))
Expand Down
18 changes: 2 additions & 16 deletions backend/oneDriveModule.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import requests
from furl import furl
from urllib.request import urlopen, unquote
from urllib.parse import urlparse
from flask import Blueprint, request, jsonify, Response, stream_with_context
from urllib.request import urlopen
from flask import Blueprint, request, jsonify

def construct_blueprint():
oneDriveModule = Blueprint('oneDriveModule', __name__)
Expand All @@ -13,16 +11,4 @@ def getAuthkey():
finalurl = res.geturl()
furled = furl(finalurl)
return jsonify({'authkey':furled.args['authkey']})

@oneDriveModule.route('/oneDriveImageProxy', methods=['GET'])
def oneDriveImageProxy():
url = unquote(request.args.get('url'))
parsedUrl = urlparse(url)
if not (parsedUrl.netloc.endswith('livefilestore.com')):
return jsonify({'error':"Image source not supported."})
req = requests.get(url, stream = True)
resp = Response(stream_with_context(req.iter_content()), content_type = req.headers['content-type'])
resp.headers['Expires'] = req.headers['Expires']
resp.headers['Cache-Control'] = req.headers['Cache-Control']
return resp
return oneDriveModule
26 changes: 0 additions & 26 deletions backend/vrtModule.py

This file was deleted.

13 changes: 0 additions & 13 deletions frontend/.babelrc

This file was deleted.

4 changes: 1 addition & 3 deletions frontend/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ root = true
[*]
end_of_line = lf
insert_final_newline = true

# 2 space indentation
[**.*]
indent_style = space
indent_size = 2
indent_size = 2
25 changes: 23 additions & 2 deletions frontend/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
{
"extends": "./node_modules/aurelia-tools/.eslintrc.json"
}
"root": true,
"extends": "eslint:recommended",
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"legacyDecorators": true
}
},
"rules": {
"no-unused-vars": 0,
"no-prototype-builtins": 0,
"no-console": 0,
"getter-return": 0
},
"env": {
"es6": true,
"browser": true,
"node": true,
"jest": true
}
}
38 changes: 36 additions & 2 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
node_modules
.idea

# You may want to customise this file depending on your Operating System
# and the editor that you use.
#
# We recommend that you use a Global Gitignore for files that are not related
# to the project. (https://help.github.com/articles/ignoring-files/#create-a-global-gitignore)

# OS
#
# Ref: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore
# Ref: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore
# Ref: https://github.com/github/gitignore/blob/master/Global/Linux.gitignore
.DS_STORE
Thumbs.db

# Editors
#
# Ref: https://github.com/github/gitignore/blob/master/Global
# Ref: https://github.com/github/gitignore/blob/master/Global/JetBrains.gitignore
# Ref: https://github.com/github/gitignore/blob/master/Global/VisualStudioCode.gitignore
.idea
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# Dependencies
node_modules

# Compiled files
/scripts
/src/environment.js
/src/environment.ts
/dist
/test/coverage-jest
/test/coverage-karma
33 changes: 33 additions & 0 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# `frontend`

This project is bootstrapped by [aurelia-cli](https://github.com/aurelia/cli).

For more information, go to https://aurelia.io/docs/cli/webpack

## Run dev app

Run `npm start`, then open `http://localhost:8080`

You can change the standard webpack configurations from CLI easily with something like this: `npm start -- --open --port 8888`. However, it is better to change the respective npm scripts or `webpack.config.js` with these options, as per your need.

To enable Webpack Bundle Analyzer, do `npm run analyze` (production build).

To enable hot module reload, do `npm start -- --hmr`.

To change dev server port, do `npm start -- --port 8888`.

To change dev server host, do `npm start -- --host 127.0.0.1`

**PS:** You could mix all the flags as well, `npm start -- --host 127.0.0.1 --port 7070 --open --hmr`

For long time aurelia-cli user, you can still use `au run` with those arguments like `au run --env prod --open --hmr`. But `au run` now simply executes `npm start` command.

## Build for production

Run `npm run build`, or the old way `au build --env prod`.

## Unit tests

Run `au test` (or `au jest`).

To run in watch mode, `au test --watch` or `au jest --watch`.
Loading

0 comments on commit 474d021

Please sign in to comment.