-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.js
More file actions
29 lines (23 loc) · 742 Bytes
/
Copy pathindex.js
File metadata and controls
29 lines (23 loc) · 742 Bytes
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
import restify from 'restify';
import Model from './src/Domain/Model/Model';
const server = restify.createServer({
name: 'restify-sequelize-example'
});
server.use(restify.acceptParser(server.acceptable));
server.use(restify.queryParser());
server.use(restify.bodyParser());
restify.CORS.ALLOW_HEADERS.push('content-type');
restify.CORS.ALLOW_HEADERS.push('accesskey');
restify.CORS.ALLOW_HEADERS.push('secretkey');
server.pre(restify.CORS({'origins': ['*']}));
require('./src/Http/Routers/User')(server);
Model((model) => {
model.sequelize.sync({
force: true
}).then(() => {
log('Schema synced successfully!');
}).catch((errResult) => {
console.log(errResult);
});
});
export default server;