Addiontal information of your project
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
Express, Knex and Typescript
Here's a brief intro about what a developer must do in order to start developing the project further:
git clone https://github.com/FilippoQuattrocchi/CommetTo-Frontend.git
cd CommetTo-Frontend/
npm install
You need to change some variables.
- 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.
- Copy .env.example, and change filename from .env.example to .env.local.
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.
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.