Skip to content

Instantly share code, notes, and snippets.

View richardr91's full-sized avatar

roll-DEEN richardr91

View GitHub Profile
@richardr91
richardr91 / app.js
Created February 24, 2021 01:52
Learning the fetch API POST method to query the astronomy API
const express = require('express');
const app = express();
app.listen(3000, () => console.log('active'));
app.use(express.static('public'));
app.use(express.json());
app.post('/api', (req, res) => {
console.log(req.body);
req.json({
status: 'success',
});