Last active
October 31, 2019 15:59
-
-
Save goldbergyoni/30db175eb8393c2a8d3cafef278404b4 to your computer and use it in GitHub Desktop.
Express API definition for component test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Note how the API gets the Express object with the connection as param | |
| //and focus on the logical defintion | |
| const initializeAPI = (expressApp) => { | |
| //A typical Express setup | |
| const router = express.Router(); | |
| expressApp.use(bodyParser.json());//other middlewares come here | |
| //add new order | |
| router.post('/', async (req, res, next) => { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment