Skip to content

Documentation: FAQ and Common Pitfalls #1245

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Feb 5, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Auto-install httpserver npm module
  • Loading branch information
bkoelman committed Jan 20, 2023
commit cc7008894ae67809a10652e6ef83a7353fa2a70c
8 changes: 2 additions & 6 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
# Intro
Documentation for JsonApiDotNetCore is produced using [DocFX](https://dotnet.github.io/docfx/) from several files in this directory.
Documentation for JsonApiDotNetCore is produced using [docfx](https://dotnet.github.io/docfx/) from several files in this directory.
In addition, the example request/response pairs are generated by executing `curl` commands against the GettingStarted project.

# Installation
Run the following command once to setup your system:

```
npm install -g httpserver
```
You need to have 'npm' installed. Download Node.js from https://nodejs.org/.

# Running
The next command regenerates the documentation website and opens it in your default browser:
Expand Down
18 changes: 15 additions & 3 deletions docs/build-dev.ps1
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#Requires -Version 7.0

# This script builds the documentation website, starts a web server and opens the site in your browser. Intended for local development.
# It is assumed that you have already installed httpserver.
# If that's not the case, run the next command:
# npm install -g httpserver

param(
# Specify -NoBuild to skip code build and examples generation. This runs faster, so handy when only editing Markdown files.
Expand All @@ -16,6 +13,21 @@ function VerifySuccessExitCode {
}
}

function EnsureHttpServerIsInstalled {
if ((Get-Command "npm" -ErrorAction SilentlyContinue) -eq $null) {
throw "Unable to find npm in your PATH. please install Node.js first."
}

npm list --depth 1 --global httpserver >$null

if ($LastExitCode -eq 1) {
npm install -g httpserver
}
}

EnsureHttpServerIsInstalled
VerifySuccessExitCode

if (-Not $NoBuild -Or -Not (Test-Path -Path _site)) {
Remove-Item _site -Recurse -ErrorAction Ignore

Expand Down