Skip to content

Comet-To/CommetTo-Backend

Repository files navigation

CommetTo-Backend · npm PRs Welcome GitHub license Static Badge Static Badge Static Badge Static Badge Static Badge

Addiontal information of your project

Installing / Getting started

A quick introduction of the minimal setup you need to get a hello world up & running.

npm install && npm run migrate-latest && npm run run migrate-seed

Built With

Express, Knex and Typescript

Setting up Dev

Here's a brief intro about what a developer must do in order to start developing the project further:

command for setup:

git clone https://github.com/FilippoQuattrocchi/CommetTo-Frontend.git
cd CommetTo-Frontend/
npm install

chage file setting:

You need to change some variables.

  1. Change .env.example variables.
//.env.example file
PORT = 3100 
NODE_ENV = 
DB_HOST = 127.0.0.1 
DB_PORT = 5432 
DB_USER = postgres 
DB_PASSWORD =         ★You should add your password to connect postgres in local.
DB_NAME = todoapp     ★You should change DB name you use.
VITE_ORIGIN = http://localhost:4173     ★The "from" URL you allow access to server.
  1. Copy .env.example, and change filename from .env.example to .env.local.

File structure in src folder

src
│-global.d.ts //Type difinitions.
│-index.ts //Express server endpoints to maniplutate data in between frontend and backend.
│-knex.ts //knex settings

└─event
  │-event.controller.ts //handle functions for http request.
          // They call data manipulation functions which communicate with database, using knex.
  └─event.model.ts //Communication functions with knex.

Implementation details

Handle CORS

It uses express middleware "CORS" and manually add response header "Access-Control-Allow-Methods" for GET, POST, PUT, DELETE method. You can define the origin which you allow to communicate with "VITE_ORIGIN" enviroment variable.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •