https://github.com/gtsopour/angular-cli-express-starter
NodeJS Express (server) with Angular CLI (client) Starter
https://github.com/gtsopour/angular-cli-express-starter
angular angular-cli express node-js nodejs
Last synced: 10 months ago
JSON representation
NodeJS Express (server) with Angular CLI (client) Starter
- Host: GitHub
- URL: https://github.com/gtsopour/angular-cli-express-starter
- Owner: gtsopour
- Created: 2017-09-29T11:29:17.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-29T13:34:40.000Z (over 8 years ago)
- Last Synced: 2025-01-21T08:11:15.702Z (12 months ago)
- Topics: angular, angular-cli, express, node-js, nodejs
- Language: TypeScript
- Size: 1.63 MB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NodeJS Express (server) with Angular CLI (client) Starter
NodeJS Express (server) with Angular CLI (client) Starter. This starter gives you the opportunity to separate totally your client and server applications ang bring them together for Development (proxy) and Production. Please note that the code in the client just came from the execution `$ ng new client` and the code in the server came from the execution `$ express --view=pug server` (after installing the Express Generator `$ npm install express-generator -g`).
## Development
```bash
$ npm run install:packages
$ npm run start
```
Browse the Application (Client):
```bash
http://localhost:4200/
```
Browse the Server:
```bash
http://localhost:8080/api
http://localhost:8080/api/users
```
The `$ npm run start` execute the following script `concurrently --kill-others \"cd client && ng serve --disable-host-check --proxy-config proxy.conf.json\" \"cd server && nodemon ./bin/www\"`. Please have in mind the client/proxy.conf.json file.
```json
{
"/api": {
"target": "http://localhost:3000",
"secure": false
}
}
```
Please note that the PORT 3000 is the default NodeJS Express PORT.
## Build (dist)
```bash
$ npm run build
```
## Run Build (production ready)
```bash
$ cd dist/server
$ PORT=8000 NODE_ENV=production node bin/www
```
Browse the Application (Client/Server):
```bash
http://localhost:8000/
http://localhost:8000/api
http://localhost:8000/api/users
```
## License
MIT © [George I. Tsopouridis](gtsopour@gmail.com)