I've task: X company has created Z school, in school there is only one class. School needs: 1. to create students' list:
a. id
b. name
c. surname
d. birth date
e. addresses
f. scores
How can I post request in node.js to get all these above information? I'm using Firebase and get request is already done. maybe I'm asking question wrongly, cause I'm an amateur and sorry for that.
This is my code:
const express = require('express');
const { admin } = require('../firebase');
const app = express();
app.get('/', (req, res) => {
const reference = admin.database().ref('/students')
reference.on('value', (snapshot) => {
res.json(snapshot.val())
reference.off('value')
}, (errorObject) => {
res.send(`somethig wrong: ${errorObject.code}`)
})
})
app.post('/', (req, res) => {
})
module.exports = app