# @jay-law/hello-world-expressjs

> ```bash

Latest version **1.0.4** (published 2022-04-01) · ISC license · 0 weekly downloads

## Install

```sh
npm install @jay-law/hello-world-expressjs
pnpm add @jay-law/hello-world-expressjs
yarn add @jay-law/hello-world-expressjs
bun add @jay-law/hello-world-expressjs
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2022-04-01 |
| First published | 2022-04-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 7 KB |
| Known vulnerabilities | 0 (+3 in 2 direct dependencies) |
| Install scripts | no |
| Maintainers | jay-law |

## Links

- npm: https://www.npmjs.com/package/@jay-law/hello-world-expressjs
- Repository: https://github.com/jay-law/hello-world-expressjs
- Homepage: https://github.com/jay-law/hello-world-expressjs#readme
- Issues: https://github.com/jay-law/hello-world-expressjs/issues
- npm.io page: https://npm.io/package/@jay-law/hello-world-expressjs

## Dependencies (6)

- [jade](https://npm.io/package/jade.md) ~1.11.0
- [debug](https://npm.io/package/debug.md) ~2.6.9
- [morgan](https://npm.io/package/morgan.md) ~1.9.1
- [express](https://npm.io/package/express.md) ~4.16.1
- [http-errors](https://npm.io/package/http-errors.md) ~1.6.3
- [cookie-parser](https://npm.io/package/cookie-parser.md) ~1.4.4

## Recent versions

- 1.0.4 (latest) — 2022-04-01
- 1.0.3 — 2022-04-01
- 1.0.2 — 2022-04-01

## README

# Creating the App 

```bash
# Create package.json scoped to my username
$ npm init --scope=@jay-law

# Build out project structure
$ npx express-generator

# npx requires npm to be installed

# Install dependencies
$ npm install

# Start server (debug mode)
$ DEBUG=hello-world-expressjs:* npm start
# or 
$ npm start
# or 
$ nodemon

# requires `nodeman` package
# npm install -g nodemon
```

# Testing

See `routes/index.js` for the available URL calls.

# Publishing

## Publish to Git

```bash
# Commit changes
$ git add .
$ git commit -m 'commit message'

# Incriment version
$ npm version (major|minor|patch)

# Push (npm creates the tags automatically)
$ git push --follow-tags
```

## Publish to NPM

### Manually Publish

```bash
# Ensure you are logged in
$ npm login

# Remove "private: true" line from package.json 

# Publish
$ npm publish --access public
```

Confirm it exists - https://www.npmjs.com/package/@jay-law/hello-world-expressjs

### Auto Publish

1. Enable token publishing for package
    - Navigate to the package page - https://www.npmjs.com/package/@jay-law/hello-world-expressjs
    - Settings -> Publishing access -> Select 'Require two-factor authentication or automation tokens'
    - Select 'Update Package Settings'
    - Be sure to create an access token for your user if needed.  Guide - https://docs.npmjs.com/creating-and-viewing-access-tokens

2. Automate publishing in GitHub
    - Navigate to the git repo
    - Select 'Actions'
    - Select 'Publish Node.js Package' then 'Configure'
    - Make changes as needed to the pipeline
    - Get the `NODE_AUTH_TOKEN` variable name.  It should be something like `${{secrets.npm_token}}`
    - Select 'Start commit' to save
    - Go to Settings ->  Secrets -> Actions
    - Select 'New repository secret'
    - Add `npm_token` for the token name and your npm token for the value 

3. Test the workflow/pipeline
    - Do a `git pull` locally to pull down the .github dir.  It contains the workflow config
    - Do the normal git stuff then push
    - Assuming all work so far has been on the main branch, a GitHub action should have been triggered
    - Confirm the publish on the NPM site

Pushes directly to the master branch should be disabled when coding in "real" environments.  

# Errors

#### Error - 'address already in use :::3000'

Node might keep port binding.  Confirm with `ps` then kill the process with `pkill -9 node --echo`

---
_Source: https://npm.io/package/@jay-law/hello-world-expressjs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
