GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - simonplend/example-nodejs-api-proxy-server: Example Node.js API proxy server built with @fastify/fastify-http-proxy

BranchesTags
Open more actions menu

Latest commit

 

History

6 Commits
6 Commits

Folders and files

NameName
Last commit message
Last commit date
article-examples
article-examples
 
 
src
src
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
.nvmrc
.nvmrc
 
 
LICENSE.md
LICENSE.md
 
 
README.md
README.md
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 

Repository files navigation

Example Node.js API proxy server

This project contains an example proxy server which allows clients to make authenticated requests to an API.

Article

This project was created as a companion to an article I've written about creating a proxy server for API requests using Node.js: How to securely call an authenticated API from your front end

Frameworks & Libraries used

  • fastify - "Fast and low overhead web framework, for Node.js"
  • fastify-http-proxy - "Proxy your http requests to another server, with hooks."
  • dotenv - "Dotenv is a zero-dependency module that loads environment variables from a .env file into process.env"

Setup

npm install

Create an .env file for use in development:

API_KEY=abc123

The .env file will be automatically loaded by dotenv when you run the example server (see below).

Running the example server

npm start

Development

If you want to test out making changes to the example proxy server, I recommend installing nodemon. It will watch for any file changes you make and take care of restarting the server for you.

Once it is installed you can run it in your terminal:

nodemon

About

Example Node.js API proxy server built with @fastify/fastify-http-proxy

simonplend.com/how-to-securely-call-an-authenticated-api-from-your-front-end/

Resources

Readme
MIT license
Activity

Stars

9 stars

Watchers

1 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.