From 7de1083fddbc19a9a6aa3152719f93a168c3e427 Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Sun, 7 Mar 2021 15:34:35 +1100 Subject: [PATCH] Finally playing nice together --- Dockerfile | 11 +---------- configure-script.js | 2 +- test/dev-news-requests.rest | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 11 deletions(-) create mode 100644 test/dev-news-requests.rest diff --git a/Dockerfile b/Dockerfile index 0f88f24..d3d1ea3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] diff --git a/configure-script.js b/configure-script.js index ed3f6a1..d4ed41c 100644 --- a/configure-script.js +++ b/configure-script.js @@ -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); diff --git a/test/dev-news-requests.rest b/test/dev-news-requests.rest new file mode 100644 index 0000000..12db194 --- /dev/null +++ b/test/dev-news-requests.rest @@ -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