Using Opaleye (DB) & Scotty (Web Server)
Run stack build && stack runghc Main.hs
then open localhost:3000/randomWord in the browser.
This app assumes you have postgresql running with the following config:
Database: opaleye
User: test
Password: qwerty
Run psql postgres -U test
and then \connect opaleye
you should see
You are now connected to database "opaleye" as user "test".
Create and populate a users
table with some data by pasting the following:
create table users(
id serial primary key
,name text not null
,email text not null
);
insert into users(name, email) values ('John', 'john@mail.com');
insert into users(name, email) values ('Bob', 'bob@mail.com');
insert into users(name, email) values ('Alice', 'alice@mail.com');