Compare commits

...

2 Commits

Author SHA1 Message Date
Kayne Ruse da62d64727 Added a nifty flag for debugging 2021-03-11 10:06:04 +11:00
Kayne Ruse 7de1083fdd Finally playing nice together 2021-03-07 15:34:35 +11:00
4 changed files with 36 additions and 12 deletions
+1 -10
View File
@@ -1,19 +1,10 @@
FROM node:15
# Change working directory
WORKDIR "/app"
# Copy package.json and package-lock.json
COPY package*.json ./
# Install npm production packages
RUN npm install --production
COPY . /app
EXPOSE 3100
USER node
ENTRYPOINT ["bash", "-c"]
CMD ["sleep 10 && npm start"]
+1 -1
View File
@@ -123,7 +123,7 @@ CMD ["sleep 10 && npm start"]
const sqlfile = `
CREATE DATABASE IF NOT EXISTS ${appName};
CREATE USER IF NOT EXISTS '${appDBUser}'@'%' IDENTIFIED BY '${appDBPass}';
GRANT ALL PRIVILEGES ON ${appName}.* TO '${appDBUser}'@'%';
GRANT ALL PRIVILEGES ON ${appName}.* TO '${appDBUser}'@'%';
`;
fs.writeFileSync('docker-compose.yml', ymlfile);
+1 -1
View File
@@ -4,7 +4,7 @@ const sequelize = new Sequelize(process.env.DB_DATABASE, process.env.DB_USERNAME
host: process.env.DB_HOSTNAME,
dialect: 'mariadb',
timezone: process.env.DB_TIMEZONE,
logging: false
logging: process.env.DB_LOGGING ? console.log : false
});
module.exports = sequelize;
+33
View File
@@ -0,0 +1,33 @@
#Query
GET https://dev-news.eggtrainer.com/news HTTP/1.1
###
#Publish
POST https://dev-news.eggtrainer.com/news HTTP/1.1
Content-Type: application/json
Authorization: Bearer
{
"title": "Hello World",
"author": "Kayne Ruse",
"body": "Lorem ipsum."
}
###
#Edit
PATCH https://dev-news.eggtrainer.com/news/1 HTTP/1.1
Content-Type: application/json
Authorization: Bearer
{
"title": "Goodnight World"
}
###
#Delete
DELETE https://dev-news.eggtrainer.com/news/1 HTTP/1.1
Content-Type: application/json
Authorization: Bearer