Created
August 9, 2018 06:00
-
-
Save conanak99/296f662942c82480cf8245886c6cad39 to your computer and use it in GitHub Desktop.
This file contains 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
const appName = require('./base'); // Dùng module base.js | |
const { ajax, show } = require('./util'); // Dùng module util.js | |
async function register(username) { | |
// Sử dụng hàm ajax và show của module util | |
await ajax.post('/register', { username }); | |
show(`Welcome ${username} to ${appName}`); | |
} | |
// Các module khác có thể dùng hàm register của module này | |
module.exports = { register }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment