68 lines
1.4 KiB
JavaScript
68 lines
1.4 KiB
JavaScript
const express = require('express')
|
|
const app = express()
|
|
const port = 3000
|
|
|
|
app.use(express.json())
|
|
|
|
// User Routes
|
|
app.post('/api/v1/user/new', (req, res) => {
|
|
res.send('Posting')
|
|
console.log(req.body)
|
|
|
|
let username = req.body['username']
|
|
console.log(`Username: ${username}`)
|
|
})
|
|
|
|
// User routes
|
|
// TODO: Not implemented
|
|
app.post('/api/v1/login', (req, res) => {
|
|
res.send('Implement');
|
|
})
|
|
|
|
// Text Routes
|
|
// Add a new text
|
|
// TODO: Not implemented
|
|
app.post('/api/v1/text/new', (req, res) => {
|
|
res.send('Create new text')
|
|
})
|
|
|
|
// Retrieve texts
|
|
// TODO: Not implemented
|
|
app.get('/api/v1/text', (req, res) => {
|
|
res.send('Create new text')
|
|
})
|
|
|
|
// Queue a text for sending
|
|
// TODO: Not implemented
|
|
app.post('/api/v1/text/queue', (req, res) => {
|
|
res.send('Queue text')
|
|
})
|
|
|
|
// Create contact
|
|
// TODO: Not implemented
|
|
app.post('/api/v1/contacts/new', (req, res) => {
|
|
res.send('Creating contact')
|
|
})
|
|
|
|
// Retrieving contacts
|
|
// TODO: Not implemented
|
|
app.get('/api/v1/contacts', (req, res) => {
|
|
res.send('Retrieving contact')
|
|
})
|
|
|
|
// Editing a contact
|
|
// TODO: Not implemented
|
|
app.patch('/api/v1/contacts', (req, res) => {
|
|
res.send('Editing contact')
|
|
})
|
|
|
|
// Deleting a contact
|
|
// TODO: Not implemented
|
|
app.delete('/api/v1/contacts', (req, res) => {
|
|
res.send('Delete contact')
|
|
})
|
|
|
|
app.listen(port, () => {
|
|
console.log(`textsender-api listening on port ${port}`)
|
|
})
|