add backend javascript project

This commit is contained in:
Matthew Chapman 2024-05-27 15:09:45 -04:00
parent 8f8fcdc46b
commit 5b315f306a
2 changed files with 30 additions and 0 deletions

19
backend-js/package.json Normal file
View File

@ -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 <m.d.chapman0202@gmail.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/mdchap/pubapptest/issues"
},
"homepage": "https://github.com/mdchap/pubapptest#readme"
}

11
backend-js/src/server.js Normal file
View File

@ -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!' });
});