Skip to content

Ujs74wiop6/api-clojure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Web API +

Simple Web CRUD using Clojure and PostgreSQL

SQL:

CREATE DATABASE produto;

CREATE TABLE items (
    id SERIAL PRIMARY KEY,
    title VARCHAR(255),
    description VARCHAR(255)
);

Use:

$ clone git@github.com:Ujs74wiop6/api-clojure.git

First of all, fill in your Postgres information

$ /api-clojure/src/crud/repository/migrations.clj

(def db {:dbtype ""
         :dbname "produto" 
         :user ""
         :password ""})

Downloading the dependencies

$ lein deps

Running the project

$ lein run

End-points

Creating the product:

curl -X POST localhost:3000/produto -H "Content-Type: application/json" -d '{"title":"Teste00", "description":"Teste00"}'

Listing all products:

curl -X GET localhost:3000/produto

Finding a product:

curl -X GET localhost:3000/produto/id

Updating a product:

curl -X PUT localhost:3000/produto/id -H "Content-Type: application/json" -d '{"title":"...", "description":"..."}'

Removing a product:

curl -X DELETE localhost:3000/produto/id

If you encounter any type of Authentication problem with your PostgreSQL: Link of StackoverFlow

About

Simple Web CRUD using Clojure and PostgreSQL

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published