Skip to content

Commit

Permalink
Added to repo
Browse files Browse the repository at this point in the history
  • Loading branch information
limitofzero committed Feb 8, 2020
1 parent f72eac3 commit 503088f
Show file tree
Hide file tree
Showing 14 changed files with 647 additions and 572 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

# dependencies
/node_modules
/server/node_modules
/server/files

# profiling files
chrome-profiler-events*.json
Expand Down
30 changes: 4 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,5 @@
# UploadProgress
Run server:
````cd server && npm install && node index.js````

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.3.12.

## Development server

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.

## Code scaffolding

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.

## Build

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.

## Running unit tests

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
Run dev angular server:
````cd client && npm install && npm run serve````
3 changes: 2 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"proxyConfig": "src/proxy.conf.json",
"browserTarget": "upload-progress:build"
},
"configurations": {
Expand Down Expand Up @@ -122,4 +123,4 @@
}
}},
"defaultProject": "upload-progress"
}
}
2 changes: 1 addition & 1 deletion e2e/src/app.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('workspace-project App', () => {

it('should display welcome message', () => {
page.navigateTo();
expect(page.getTitleText()).toEqual('upload-progress app is running!');
expect(page.getTitleText()).toEqual('uploadBtn-progress app is running!');
});

afterEach(async () => {
Expand Down
2 changes: 1 addition & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = function (config) {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, './coverage/upload-progress'),
dir: require('path').join(__dirname, './coverage/uploadBtn-progress'),
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"start": "ng serve --proxyConfig=./src/proxy.conf.json",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
Expand Down
19 changes: 19 additions & 0 deletions server/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const express = require("express");
const multer = require("multer");

const app = express();

const upload = multer({ dest:"files" });

app.post("/upload", upload.single("file"), function (req, res) {
const { file } = req;

if (file) {
res.send({ upload: 'success '});
} else {
res.error("Error");
}

});

app.listen(3000);
Loading

0 comments on commit 503088f

Please sign in to comment.