Finally playing nice together
This commit is contained in:
+1
-10
@@ -1,19 +1,10 @@
|
|||||||
|
|
||||||
FROM node:15
|
FROM node:15
|
||||||
|
|
||||||
# Change working directory
|
|
||||||
WORKDIR "/app"
|
WORKDIR "/app"
|
||||||
|
|
||||||
# Copy package.json and package-lock.json
|
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
|
|
||||||
# Install npm production packages
|
|
||||||
RUN npm install --production
|
RUN npm install --production
|
||||||
|
|
||||||
COPY . /app
|
COPY . /app
|
||||||
|
|
||||||
EXPOSE 3100
|
EXPOSE 3100
|
||||||
|
|
||||||
USER node
|
USER node
|
||||||
|
|
||||||
ENTRYPOINT ["bash", "-c"]
|
ENTRYPOINT ["bash", "-c"]
|
||||||
CMD ["sleep 10 && npm start"]
|
CMD ["sleep 10 && npm start"]
|
||||||
|
|||||||
+1
-1
@@ -123,7 +123,7 @@ CMD ["sleep 10 && npm start"]
|
|||||||
const sqlfile = `
|
const sqlfile = `
|
||||||
CREATE DATABASE IF NOT EXISTS ${appName};
|
CREATE DATABASE IF NOT EXISTS ${appName};
|
||||||
CREATE USER IF NOT EXISTS '${appDBUser}'@'%' IDENTIFIED BY '${appDBPass}';
|
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);
|
fs.writeFileSync('docker-compose.yml', ymlfile);
|
||||||
|
|||||||
@@ -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
|
||||||
Reference in New Issue
Block a user