Skip to content

API that is able to store to a postgres database some activities, and then show them to the client. Made in one day :)

Notifications You must be signed in to change notification settings

lluisaliano/expressFirstAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Express API with TypeScript and PostgreSQL

This project is a simple Express API built using TypeScript. It is my first backend project, developed within a day! The API stores information in a PostgreSQL database.

Features

TypeScript: Utilizes the power of static typing.
Database: Stores data in a PostgreSQL database.
Fast Development: Created in just one day!

Prerequisites

Before you begin, ensure you have the following installed:

Node.js
PostgreSQL

Installation

Clone this repository:

git clone https://github.com/lluisaliano/expressFirstAPI.git
cd first-express-api

Install dependencies:

npm install

Set up your environment variables. Change user and password on utils/pgsql.ts file.

Initialize postgres:

CREATE DATABASE expressapi;

CREATE TABLE activities (id, name, location, information, category, price);        

Run the app:

npm run dev

Open http://localhost:3000 in your browser.

API Endpoints

GET /: Retrieve all items.
POST /: Create a new item.
POST /close: Close database connection.

About

API that is able to store to a postgres database some activities, and then show them to the client. Made in one day :)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published