String str = "asd";
var str string = "asd"
let str = "asd";
(defparameter str "asd")
var locals = res.locals;
locals.title = 'Blabla';
locals.keyAccess = req.session.keyAccess;
res.render('index');
app.post('/login', function(req, res, next) {
if(!req.body.password) req.body.password = ' ';
passport.authenticate('local', function(err, user, info) {
if (err) {
return next(err);
}
if (!user) {
console.log('no user');
return res.redirect('/unautorized');
}
req.logIn(user, function(err) {
if (err) {
return next(err);
}
console.log('success');
return res.redirect('/');
});
})(req, res, next);
});
if(!req.body.password) req.body.password = " ";
if (!user.validPassword(password))
type Book struct {
Isbn string
Title string
Author string
Price float32
}
var Books struct {
Items []*Book
}
var db *sql.DB
func init() {
var err error
db, err = sql.Open("postgres", "postgresql://postgres:f,hbrjc@localhost:5432/bookstore?sslmode=disable")
if err != nil {
log.Fatal(err)
}
if err = db.Ping(); err != nil {
log.Fatal(err)
}
}
func main() {
http.HandleFunc("/books", booksIndex)
http.HandleFunc("/books/show", booksShow)
//http.HandleFunc("/books/create", booksCreate)
fmt.Println("PORT = 9000")
http.ListenAndServe("localhost:9000", nil)
}