Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
github.com/awiz911/contacts-learning
Description
This project is a Go learning project with simple RestFul API. It uses postgres db inside with docker-compose. You can compose with dockerfile or create your own postgres database without it.
To run docker-compose(in project folder):
cd docker
docker-compose up
PostgreSQL works on 32300 Port (32300 -> 5432). You can access with database IDE (DataGrip etc.) with configure port 32300.
If you want to connect from your host system type the following command to terminal.
psql -h localhost -p 32300 -d docker -U docker --password
Database table configuration
CREATE TABLE USERS (
ID INT PRIMARY KEY,
NAME TEXT NOT NULL,
LASTNAME TEXT NOT NULL,
AGE INT NOT NULL
CELL TEXT NOT NULL,
EMAIL TEXT NOT NULL
);
CREATE SEQUENCE public.users_id_seq NO MINVALUE NO MAXVALUE NO CYCLE;
ALTER TABLE public.users ALTER COLUMN id SET DEFAULT nextval('public.users_id_seq');
ALTER SEQUENCE public.users_id_seq OWNED BY public.users.id;
Database access configuration inside code Under config/config.go directory in the project, you will find database access configuration. You can change it with your custom configuration(need to change it in docker-compose.yml as well)
DB_USER = "docker"
DB_PASSWORD = "docker"
DB_NAME = "docker"
PORT = "32770"
To start service(after starting PSQL in docker) type commands in your working terminal:
Get package neccessary for postgreesql in go.
go get github.com/lib/pq
Start service
go run main.go
If there is no error then you should be able to work with service on http://127.0.0.1:3000
http://127.0.0.1:3000/clients/
List all clients (GET)
Add new client with JSON(POST)
{ "name": "mockName", "lastname": "mockSurname", "age": 30 "cell": 348094834 "email": mockemail@yahoo.com }
http://127.0.0.1:3000/clients/
List one client with given ID (GET)
Update one client with given ID (PUT)
Delete one client with given ID (DELETE)
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.