Skip to content

cmditch/haskell-scotty-practice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Haskell Web Server & Database

Using Opaleye (DB) & Scotty (Web Server)

Opaleye Docs

Run stack build && stack runghc Main.hs then open localhost:3000/randomWord in the browser.

Database Config

This app assumes you have postgresql running with the following config:

Database: opaleye  
User:     test  
Password: qwerty  

Database Setup

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');

About

Haskell with basic Web Server and Database

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published