forked from Knighton910/Keystone-Express
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
37 lines (30 loc) · 1.03 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
var express = require('express'),
app = express(),
keystone = require('keystone'),
serve = require('serve-static'),
favicon = require('serve-favicon'),
body = require('body-parser'),
cookieParser = require('cookie-parser'),
multer = require('multer');
var cookieSecret = 'secretCookie'
app.use(cookieParser(cookieSecret));
app.use(body.urlencoded({ extended: true }));
app.use(body.json());
app.use(multer());
keystone.init({
'name': 'KeystoneExpress', 'brand': 'KeystoneExpress',
'session': false, 'updates': 'updates',
'auth': true, 'user model': 'No',
'cloudinary config': 'cloudinary://api_key:api_secret@cloud_name',
'auto update': true, 'cookie secret': cookieSecret
});
// Let keystone know where your models are defined. Here we have it at the `/models`
keystone.import('models');
// Serve your static assets
app.use(serve('./public'));
// This is where your normal routes and files are handled
app.get('/', function(req, res, next) {
res.send('hello world');
});
keystone.app = app;
keystone.start();