✒️
poocho • documentation
  • Introduction
  • Basics
    • To Do
    • Logins
    • Table of Contents
  • Useful Commands
  • Environments
    • Local Environment Setup
      • macOS setup
      • Routes
    • Remote Server Setup
      • Server Setup
      • Client Environment
    • AWS Cognito Setup
    • Dockerhub
  • Server Info
    • Application
      • ** NATS
      • Dependencies
      • Main Stack
    • Server Information
      • Continuous Integration
      • Servers
        • Amazon Web Services
        • Digital Ocean
      • Code Repositories
      • Domains In Use
      • Email Settings
      • Domain Hosts & Registration
        • Domain Registrar (NameCheap)
        • DNS Host (Cloudflare)
        • Email (Gsuite)
    • External Services
      • Landbot.io
      • Flow.ai
    • Amazon Web Services (AWS)
      • AWS EC2/EBS
      • AWS Simple Email Service
      • AWS Cognito (v2)
      • AWS Cognito
      • AWS Lightsail
      • AWS Route 53
  • Code & Documentation
    • Client
    • Functions
    • Server
Powered by GitBook
On this page
  • Simple Node with Express + PostgreSQL Server
  • Features
  • Requirements
  • Installation

Was this helpful?

  1. Code & Documentation

Server

PreviousFunctions

Last updated 5 years ago

Was this helpful?

Simple Node with Express + PostgreSQL Server

An easy way to get started with a Express server with PostgreSQL with Node.js.

Features

  • Babel 7

  • Environment Variables

  • Express

  • REST API

  • PostgreSQL

Requirements

Installation

  • git clone git@github.com:rwieruch/node-express-postgresql-server.git

  • cd node-express-postgresql-server

  • npm install

  • npm start

  • optional: include .env in your .gitignore

GET Routes

    • /messages

    • /messages/1

    • /users

    • /users/1

Beyond GET Routes

CURL

  • Create a message with:

    • curl -X POST -H "Content-Type:application/json" http://localhost:3000/messages -d '{"text":"Hi again, World"}'

  • Delete a message with:

    • curl -X DELETE -H "Content-Type:application/json" http://localhost:3000/messages/1

Postman

  • Create a message with:

    • Method: POST

    • Body: raw + JSON (application/json)

    • Body Content: { "text": "Hi again, World" }

  • Delete a message with:

    • Method: DELETE

visit

Install to interact with REST API

URL:

URL:

http://localhost:3000
Postman
http://localhost:3000/messages
http://localhost:3000/messages/1
Read more about it.
node & npm
git
start PostgreSQL
Build Status
Slack
Greenkeeper badge