Skip to content

Instantly share code, notes, and snippets.

@goldbergyoni
Last active October 31, 2019 15:59
Show Gist options
  • Select an option

  • Save goldbergyoni/30db175eb8393c2a8d3cafef278404b4 to your computer and use it in GitHub Desktop.

Select an option

Save goldbergyoni/30db175eb8393c2a8d3cafef278404b4 to your computer and use it in GitHub Desktop.
Express API definition for component test
//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