|
1 | | -# Node & Express Demo App for GitHub Actions, Azure DevOps, and Beyond |
| 1 | +# Node Express Azure - AZ-400 Demo App |
2 | 2 |
|
3 | | -## Last edited by Tim Warner |
| 3 | +Sample Node.js Express application for demonstrating CI/CD pipelines in AZ-400 training. |
4 | 4 |
|
5 | | -> Build Your First CI/CD Pipeline using Azure DevOps with this Demo App. |
| 5 | +## Features |
6 | 6 |
|
7 | | -This is a Node and Express web application used to demonstrate CI/CD with Azure DevOps. You can clone this repo and use it within Azure DevOps to build, test, and release to an Azure App Service web app. |
| 7 | +- Express.js web application |
| 8 | +- Handlebars templating |
| 9 | +- Mocha/Chai testing with mochawesome reports |
| 10 | +- ESLint for code quality |
| 11 | +- Docker support |
| 12 | +- Azure DevOps and GitHub Actions ready |
8 | 13 |
|
9 | | -[](https://github.com/codespaces/new/timothywarner/node-express-azure) |
| 14 | +## Getting Started |
10 | 15 |
|
11 | | -## Running and Testing Locally: |
| 16 | +### Prerequisites |
12 | 17 |
|
13 | | -You can use these commands to install, test, and run the app locally. (Not Required) |
| 18 | +- Node.js 18.x or higher |
| 19 | +- npm 8.x or higher |
14 | 20 |
|
15 | | -### Install |
| 21 | +### Installation |
16 | 22 |
|
17 | | -``` |
| 23 | +```bash |
18 | 24 | npm install |
19 | 25 | ``` |
20 | 26 |
|
21 | | -### Test |
| 27 | +### Running Locally |
22 | 28 |
|
| 29 | +```bash |
| 30 | +npm start |
23 | 31 | ``` |
| 32 | + |
| 33 | +The app will be available at http://localhost:3000 |
| 34 | + |
| 35 | +### Running Tests |
| 36 | + |
| 37 | +```bash |
24 | 38 | npm test |
25 | 39 | ``` |
26 | 40 |
|
27 | | - |
| 41 | +### Linting |
28 | 42 |
|
29 | | -Navigate to the `/test` folder to review the unit tests for this project. These tests will run as part of your Azure DevOps Build pipeline. See `azure-pipelines.yml` in this repo. |
| 43 | +```bash |
| 44 | +npm run lint |
| 45 | +``` |
30 | 46 |
|
31 | | -### Start |
| 47 | +### Docker |
32 | 48 |
|
| 49 | +Build the image: |
| 50 | +```bash |
| 51 | +docker build -t nodeapp-1 . |
33 | 52 | ``` |
34 | | -npm start |
| 53 | + |
| 54 | +Run the container: |
| 55 | +```bash |
| 56 | +docker run -p 3000:3000 nodeapp-1 |
35 | 57 | ``` |
36 | 58 |
|
| 59 | +## CI/CD Pipelines |
| 60 | + |
| 61 | +This app includes example pipelines for: |
| 62 | +- Azure Pipelines (see `/pipelines` folder in repo root) |
| 63 | +- GitHub Actions (see `.github/workflows` in repo root) |
| 64 | + |
| 65 | +## Azure Artifacts |
| 66 | + |
| 67 | +To publish to Azure Artifacts: |
| 68 | + |
| 69 | +1. Create `.npmrc` from `.npmrc.template` |
| 70 | +2. Set up authentication |
| 71 | +3. Run `npm run publish:dev` or `npm run publish:prod` |
37 | 72 |
|
38 | | -### License |
| 73 | +## Environment Variables |
39 | 74 |
|
40 | | -This project is licensed under the Apache License 2.0 |
| 75 | +- `PORT` - Server port (default: 3000) |
| 76 | +- `NODE_ENV` - Environment (development/production) |
| 77 | +- `AZURE_ARTIFACTS_FEED` - Azure Artifacts feed URL |
0 commit comments