Skip to content

Commit

Permalink
events
Browse files Browse the repository at this point in the history
Signed-off-by: Nirmal Khedkar <nirmalhk7@gmail.com>
  • Loading branch information
nirmalhk7 committed Apr 11, 2021
1 parent aedf2f3 commit 2a7d1bd
Show file tree
Hide file tree
Showing 7 changed files with 121 additions and 0 deletions.
52 changes: 52 additions & 0 deletions api/events/config/routes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"routes": [
{
"method": "GET",
"path": "/events",
"handler": "events.find",
"config": {
"policies": []
}
},
{
"method": "GET",
"path": "/events/count",
"handler": "events.count",
"config": {
"policies": []
}
},
{
"method": "GET",
"path": "/events/:id",
"handler": "events.findOne",
"config": {
"policies": []
}
},
{
"method": "POST",
"path": "/events",
"handler": "events.create",
"config": {
"policies": []
}
},
{
"method": "PUT",
"path": "/events/:id",
"handler": "events.update",
"config": {
"policies": []
}
},
{
"method": "DELETE",
"path": "/events/:id",
"handler": "events.delete",
"config": {
"policies": []
}
}
]
}
8 changes: 8 additions & 0 deletions api/events/controllers/events.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use strict';

/**
* Read the documentation (https://strapi.io/documentation/developer-docs/latest/development/backend-customization.html#core-controllers)
* to customize this controller
*/

module.exports = {};
8 changes: 8 additions & 0 deletions api/events/models/events.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use strict';

/**
* Read the documentation (https://strapi.io/documentation/developer-docs/latest/development/backend-customization.html#lifecycle-hooks)
* to customize this model
*/

module.exports = {};
17 changes: 17 additions & 0 deletions api/events/models/events.settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"kind": "collectionType",
"collectionName": "events",
"info": {
"name": "Events"
},
"options": {
"increments": true,
"timestamps": true,
"draftAndPublish": true
},
"attributes": {
"title": {
"type": "string"
}
}
}
8 changes: 8 additions & 0 deletions api/events/services/events.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use strict';

/**
* Read the documentation (https://strapi.io/documentation/developer-docs/latest/development/backend-customization.html#core-services)
* to customize this service
*/

module.exports = {};
25 changes: 25 additions & 0 deletions config/env/production/database.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
const parse = require('pg-connection-string').parse;
const config = parse(process.env.DATABASE_URL);

module.exports = ({ env }) => ({
defaultConnection: 'default',
connections: {
default: {
connector: 'bookshelf',
settings: {
client: 'postgres',
host: config.host,
port: config.port,
database: config.database,
username: config.user,
password: config.password,
ssl: {
rejectUnauthorized: false,
},
},
options: {
ssl: true,
},
},
},
});
3 changes: 3 additions & 0 deletions config/env/production/server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = ({ env }) => ({
url: env('HEROKU_URL'),
});

0 comments on commit 2a7d1bd

Please sign in to comment.