diff --git a/backend-js/package.json b/backend-js/package.json new file mode 100644 index 0000000..e2c8545 --- /dev/null +++ b/backend-js/package.json @@ -0,0 +1,19 @@ +{ + "name": "pubapptest-backend-js", + "version": "1.0.0", + "description": "", + "main": "src/server.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/mdchap/pubapptest.git" + }, + "author": "Matt Chapman ", + "license": "MIT", + "bugs": { + "url": "https://github.com/mdchap/pubapptest/issues" + }, + "homepage": "https://github.com/mdchap/pubapptest#readme" +} diff --git a/backend-js/src/server.js b/backend-js/src/server.js new file mode 100644 index 0000000..9e5a3fc --- /dev/null +++ b/backend-js/src/server.js @@ -0,0 +1,11 @@ +import express from 'express'; +import bodyParser from 'body-parser'; +import cors from 'cors'; + +const app = express(); +app.use(cors()); +app.use(bodyParser.json()); + +app.get('/api', (req, res) => { + res.json({ message: 'Hello from server!' }); +});