You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
376 B
JavaScript
18 lines
376 B
JavaScript
const express = require("express")
|
|
const fs = require('fs')
|
|
|
|
const app = express()
|
|
const PORT = process.env.PORT || 8997
|
|
|
|
app.use(express.static("public"))
|
|
app.use(express.json())
|
|
|
|
app.post('/', function requestHandler(req,res) {
|
|
fs.appendFile('./database.txt', req.body.toString() + "\n")
|
|
|
|
}
|
|
|
|
app.listen(PORT, () => {
|
|
console.log(`Server is running on port ${PORT}`);
|
|
})
|