The Node.js server component for the Face Recognition App.
To run:
- Clone the repo
- Set DATABASE_URL environement variable to your
postgres://
connection string. - Set the Environment variable CLARIFAI_KEY to your API Key from Clarifai
- run
npm install
- run
npm start
Use the Face Recognition app to interact with the API, or build your own app.
GET /
List usersPOST /signin
(:email,:password) Validate a userPOST /register
(:email, :name, :password) Register a new userGET /profile/:id
(:user.id) Get the profile of a specified userPUT /image
(:user.id) Increment theuser.entries
value for the indicated userGET /imageurl
(:input) Detect faces in the specified image URL
By default, the server listens on port 3000 unless a process.env.PORT
is found
You will need a PostgreSQL server (or change it if you wish).
Database tables required are:
CREATE TABLE users (
id serial PRIMARY KEY,
name varchar(100),
email text UNIQUE NOT NULL,
entries bigint DEFAULT 0,
joined timestamp NOT NULL
);
CREATE TABLE login (
id serial PRIMARY KEY,
email text UNIQUE NOT NULL,
hash varchar(100) NOT NULL
);